Regex Tester

Test and debug regular expressions online with live match highlighting, capture groups, and a handy cheat sheet. Free and private.

/ /
Flags
Ready.

No matches yet.

How to use the Regex Tester

  1. Type your regular expression into the Pattern box (no slashes needed).
  2. Toggle the flags you need — g for all matches, i for case-insensitive, and so on.
  3. Paste your test string below; every match is highlighted live as you type.
  4. Check the match count and inspect each match’s capture groups in the results table.

Regex cheat sheet

.Any char except newline
\dDigit (0–9)
\DNon-digit
\wWord char [A-Za-z0-9_]
\WNon-word char
\sWhitespace
\SNon-whitespace
\bWord boundary
^Start of string / line
$End of string / line
*0 or more
+1 or more
?0 or 1 (optional)
{n,m}Between n and m times
[abc]Any one of a, b, c
[^abc]None of a, b, c
(...)Capture group
(?:...)Non-capturing group
(?<n>...)Named group
a|ba or b (alternation)

Frequently asked questions

Which regex engine does this use?
It uses your browser’s built-in JavaScript (ECMAScript) regular expression engine, so the syntax matches what you’d write in JavaScript, Node.js, and most modern tools.
What do the flags mean?
g finds all matches, i ignores case, m makes ^ and $ match line boundaries, s lets . match newlines, u enables full Unicode, and y anchors matching at the current position (sticky).
Why is my pattern shown as invalid?
The status line reports the exact syntax error from the engine — common causes are an unclosed group or bracket, a dangling \, or a quantifier with nothing to repeat.
Is my pattern or test text sent anywhere?
No. All matching happens privately in your browser with JavaScript. Nothing you type is ever uploaded, logged, or stored.