Regex Tester
Test JavaScript regular expressions live. Match highlighting, capture groups, replace mode, and all flags supported.
/
/
Matches
0
Regex flag reference
| Flag | Effect |
|---|---|
g | Global — find all matches, not just the first |
i | Case-insensitive matching |
m | Multiline — ^ and $ match line starts/ends, not just string boundaries |
s | dotAll — . also matches newlines |
u | Unicode — proper handling of surrogate pairs and Unicode property escapes |
y | Sticky — 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
- JavaScript regex doesn't support lookbehind in older browsers (it's universally supported as of 2022).
- JavaScript supports both
\d(Latin digits) and Unicode property escapes\p{Nd}(with theuflag) — the latter matches any digit script. - The
x"extended" flag (whitespace + comments in pattern) is not supported in JavaScript.