Regex Tester
Test JavaScript RegExp with highlighted matches + replacement preview.
How Regex Tester works
Enter a JavaScript RegExp pattern — no delimiters needed, they're implied. Add flags (g, i, m, s, u, y) in the second field.
As you type, every match is highlighted in yellow inside your test string. The match count is shown above the highlighted area.
Add a replacement string (with $1, $2 for capture groups) to see the substituted output live.
Frequently asked
Which regex dialect is this?+
JavaScript's built-in RegExp — the same engine V8, JavaScriptCore and SpiderMonkey use. Non-JS features (recursion, `(?R)`, `\R`) are not supported.
Why do I get an infinite loop warning?+
We advance lastIndex manually on zero-width matches to avoid the classic infinite loop when `g` is set. You shouldn't see this in practice.
Can I test PCRE / Python regex here?+
Sort of — the core syntax overlaps 90%. But features like `(?P<name>...)`, `\p{...}` categories (before v flag), and possessive quantifiers behave differently.