How to use the regex tester
- Type your pattern between the slashes — no need to escape the slashes themselves.
- Toggle flags:
g all matches, i ignore case, m ^ and $ per line, s dot matches newlines, u Unicode, y sticky. - Paste test text. Matches highlight instantly; the table lists each match, its position and its groups.
- Open Replace to preview
String.replace with $1, $<name> and $&.
Which regex flavour is this?
JavaScript (ECMAScript 2024), exactly what new RegExp() does in your browser and in Node.js. It supports lookbehind, named groups and Unicode property escapes like \p{L}. PCRE (PHP), Python and Java are very similar for everyday patterns; the differences are mostly in advanced features such as possessive quantifiers, atomic groups and inline flags, which JavaScript lacks.
Explain and generate with AI
The token breakdown is computed instantly on the page. For a fuller, contextual explanation — or to describe what you want in words and get a pattern — use the AI buttons. The result is loaded into the tester so you can verify it against real text before you trust it.
Questions
Is this like regex101?
It covers the same core job for JavaScript regex — live highlighting, groups, flags, substitution and an explanation — on a lighter page that also works on a phone.
Why does my pattern match an empty string forever?
Patterns such as a* can match zero characters. The tester advances past empty matches so the page never hangs, and shows them as zero-width markers.
Are my patterns saved?
Your last pattern, flags and test text are kept in this browser (localStorage) so they’re there when you come back. Clear them from the privacy page or with the Clear button.
Can it write a regex for me?
Yes. Describe what you want to match in plain English under Ask AI and press Write it. The generated pattern and sample text are loaded into the tester so you can check it against real input before using it.
How do I test a Python or PHP regex?
Most everyday syntax (classes, quantifiers, groups, lookahead) is identical. Differences: Python writes named groups as (?P<name>…) — use (?<name>…) here — and JavaScript has no possessive quantifiers or atomic groups.
How do I match a literal dot or bracket?