Regex Tester

Test JavaScript regular expressions with live highlighting, capture groups, flags and replacement preview.

Runs in your browser. Your input is processed on your device and is not uploaded to our server.

/ /
Flags: g global, i ignore case, m multiline, s dot matches newline, u unicode, y sticky, d indices.

Matches


    
#MatchIndexGroups

How to use the Regex Tester

  1. Enter a pattern and choose flags (g, i, m, s, u, y).
  2. Type or paste the test text; matches are highlighted as you type.
  3. Inspect capture groups and try a replacement string.

The tester uses the JavaScript (ECMAScript) regular expression engine of your browser, including named groups, lookbehind and Unicode property escapes. Very slow patterns are stopped automatically so the page stays responsive. Syntax differs slightly in other languages such as PHP (PCRE), Python and Java.

Frequently asked questions

Why does my pattern match nothing with the g flag off?
Without g only the first match is shown. Turn on g to see all matches.
What is catastrophic backtracking?
Patterns with nested quantifiers like (a+)+ can take exponential time on some inputs. The tester stops evaluation after a time limit.