Regex Tester

Regex Tester — write and test JavaScript regex patterns. See live highlights, capture groups, and replacement previews. Free, no signup.

Pattern
/ /g
Test string
Awaiting pattern
Matches
Highlighted text

          
Match list
No matches yet
Replace
Type a replacement to preview

About Regex Tester

Frequently asked questions

JavaScript / ECMAScript regex — the same engine used by V8 (Chrome, Node.js), JavaScriptCore (Safari), and SpiderMonkey (Firefox). It supports all the modern JS features: named groups (`(?<name>...)`), lookbehind (`(?<=...)`), unicode flag (`/u`), sticky flag (`/y`), and dotall (`/s`). If you're writing regex for a JavaScript app, this is the right tester.

Six flags: `g` (global — find all matches, not just the first), `i` (case-insensitive), `m` (multiline — `^` and `$` match line boundaries), `s` (dotall — `.` matches newlines), `u` (full unicode support, enables `\u{...}` escapes), `y` (sticky — match must start at lastIndex). Toggle the boxes above the pattern to switch them on or off.

Every match shows its groups in the match list below the highlighted text. Numbered groups show as `$1`, `$2`, etc. Named groups (`(?<email>...)`) show with the name as the key. If a group didn't participate in a match (e.g. inside an OR that didn't match its branch), it's skipped.

Yes — the Replace section previews the result of running `text.replace(pattern, replacement)` live. Replacement supports the full JavaScript replace syntax: `$1`-`$9` for capture groups, `$&` for the entire match, `$\`` for everything before the match, `$'` for everything after, and `$$` for a literal dollar sign.