Regex Tester

Test regular expressions against real text. Toggle flags, see every match with its position, and catch invalid patterns instantly.

StatusWaiting for input
Advertisement

How to use the regex tester

  1. Type your regular expression into the pattern field — for example \b\w+@\w+\.\w+\b to find email-like text.
  2. Toggle the flags you need: g for all matches, i for case-insensitive matching, m for multiline anchors, and s so the dot also matches newlines.
  3. Paste the text you want to search into the test string box.
  4. The results update as you type, showing whether it matches, how many matches were found, and each match with its character index.

Understanding the flags

FlagWhat it does
gGlobal — finds every match in the string instead of stopping at the first.
iIgnore case — makes letters match regardless of uppercase or lowercase.
mMultiline — lets ^ and $ match at the start and end of each line.
sDotAll — lets the dot (.) also match newline characters.

Why test your regex here

Regular expressions are powerful but notoriously easy to get subtly wrong. A pattern that works on one test string can silently fail on another, and a misplaced quantifier can turn a quick match into catastrophic slowdown. Testing a pattern before you ship it into code — a form validator, a log parser, a find-and-replace rule — catches those problems early.

This tester builds the pattern with the JavaScript RegExp constructor inside a try/catch block. If your pattern has a syntax error, such as an unclosed group or a dangling backslash, it reports the error message directly instead of failing silently. That immediate feedback is the fastest way to learn regex or debug a pattern that is misbehaving.

A note on empty matches

Some patterns, like a*, can match an empty string at many positions. The tester detects empty matches and advances automatically so it never gets stuck in an infinite loop, while still listing every real match alongside its index in the original text.

Frequently asked questions

No. The tester runs entirely in your browser using JavaScript. Your pattern and text never leave your device.
It means your regular expression has a syntax error, such as an unclosed bracket or group. The error message tells you what is wrong so you can fix it.
Yes. It uses the same RegExp engine your browser runs, so results match what you would get in JavaScript code exactly.
Yes, completely free with no signup and no limits.