Skip to content
Developer

Regex Tester

Type a JavaScript regular expression and test text. Matches highlight live, capture groups and indices show in a clean list, replace mode previews substitutions, and a cheat sheet keeps syntax close at hand.

//g
Flags
Highlighted matches2 matches
Reach out to hello@toolsrange.com or sales@example.org — both work.
#1hello@toolsrange.com@13
$1hello
$2toolsrange.com
#2sales@example.org@37
$1sales
$2example.org
Common patterns (one click loads pattern + sample text)
Regex cheat sheet
Character classes
.Any char (except newline)
\dDigit (0-9)
\DNon-digit
\wWord char (letter, digit, _)
\WNon-word
\sWhitespace
\SNon-whitespace
[abc]Any of a, b, c
[^abc]None of a, b, c
[a-z]Range (lowercase letters)
Quantifiers
*0 or more (greedy)
+1 or more
?0 or 1 (also: lazy)
{n}Exactly n
{n,}n or more
{n,m}Between n and m
*?0 or more (lazy)
+?1 or more (lazy)
Anchors & groups
^Start of input/line (with m)
$End of input/line (with m)
\bWord boundary
\BNon-boundary
(...)Capture group
(?:...)Non-capturing group
(?<n>...)Named group
(?=...)Positive lookahead
(?!...)Negative lookahead
|Alternation (or)

Your patterns and test text are processed entirely in your browser.

How to use this regex tester

  1. Type your pattern between the / / and toggle flags (g, i, m, s, u, y).
  2. Paste your test text — every match highlights live with capture groups numbered.
  3. Switch to Replace mode to preview substitutions ($1, $2, $<name>, $&).
  4. Use the common patterns or open the cheat sheet for syntax help.

Frequently asked questions

Which regex flavor is supported?

JavaScript regex (ECMAScript), the same engine your browser uses. That's slightly different from PCRE / Python — most syntax overlaps but lookbehind support and certain Unicode classes vary.

Are matches limited?

The first 200 matches are listed in detail; the highlighter shows all of them. There's a 50,000-match safety stop for runaway patterns.

What about lookbehind?

Modern browsers support both lookahead (?=…)(?!…) and lookbehind (?<=…)(?<!…). The tester runs in your browser, so it matches your browser's exact regex behavior.

Is anything sent to a server?

No. Patterns and text stay in your browser.