Regex Tester

Test regular expressions with live matching and highlighting.

/ /

Quick Reference

. Any character except newline
\d Digit [0-9]
\w Word char [a-zA-Z0-9_]
\s Whitespace
^ Start of string/line
$ End of string/line
* Zero or more
+ One or more
? Zero or one
{n,m} Between n and m times
(abc) Capture group
(?:abc) Non-capture group
[abc] Character class
[^abc] Negated class
a|b Alternation (or)
\b Word boundary

Frequently Asked Questions

What regex flavors does this tool support?

The tool uses JavaScript's RegExp engine, which supports most common regex features: character classes, quantifiers (greedy and lazy), alternation, capturing and non-capturing groups, lookahead and lookbehind assertions, named groups, and Unicode property escapes. It covers virtually all common regex use cases.

What do the different flags mean?

The main flags are: g (global — find all matches, not just the first), i (case-insensitive), m (multiline — ^ and $ match line boundaries), s (dotAll — dot matches newline), u (unicode mode), and y (sticky — match from lastIndex). You can toggle each flag independently.

How do I view capture groups?

The tool displays all capture groups for each match in a structured table. Named groups (using ?<name> syntax) show the group name alongside the captured value. This makes it easy to verify that your groups are capturing exactly the text you intend.

Can I test regex replacements?

Yes — enter a replacement pattern to see the substitution result in real time. The replacement supports $1-$9 for numbered groups, $<name> for named groups, $& for the full match, and $` and $' for text before and after the match.

Is there a quick reference for regex syntax?

Yes — the tool includes a built-in cheat sheet covering character classes (\d, \w, \s), quantifiers (*, +, ?, {n,m}), anchors (^, $, \b), groups and assertions, and common patterns. This reference stays visible alongside your testing area for quick lookup.