Regex Tester

Test JavaScript regular expressions live. Match highlighting, capture groups, replace mode, and all flags supported.

๐Ÿ“– Read the guide: Common regex patterns

/ /
Matches
0

Regex flag reference

FlagEffect
gGlobal โ€” find all matches, not just the first
iCase-insensitive matching
mMultiline โ€” ^ and $ match line starts/ends, not just string boundaries
sdotAll โ€” . also matches newlines
uUnicode โ€” proper handling of surrogate pairs and Unicode property escapes
ySticky โ€” match must start at lastIndex

Capture groups

Parentheses (...) capture matched substrings. Named groups use (?<name>...). Non-capturing groups use (?:...) when you need to group without capturing. In replace mode, refer back to captures with $1, $2, etc., or $<name> for named groups.

Common JavaScript-specific differences