How to use
- Type a regular expression in the pattern field (without the surrounding
/…/slashes — only the pattern itself). - Turn flags on or off: g for every match, i for case-insensitive, m for multiline
^/$, s so.matches newlines, u for Unicode, y for sticky matching. - Paste or type the text you want to test. Matches highlight as you type; the list below shows each match, its index, and capture groups (numbered and named).
- Use Copy matches to put every full match on the clipboard (one per line). Clear resets pattern, text, and flags.
- Pattern explanation breaks the regex into parts and says, in plain English, what each one matches.
- Under Code, pick JavaScript, Python, Java, C#, PHP, or Go to get a ready-to-paste snippet with your pattern and flags, plus warnings for anything that language does not support.
Everything runs in your browser. Your pattern and sample text are not uploaded and are never put in the page URL.
What it’s for
Regular expressions show up in form validation, log filtering, search-and-replace in editors, API gateways, and test assertions. Writing a pattern from memory is easy; proving it against a real string is where mistakes hide — an unescaped dot, a greedy quantifier, a missing flag. A live tester shortens that loop: change the pattern, see the highlights, inspect the groups, fix the bug.
This page is for developers, QA, and anyone debugging a filter or validator. You can paste a log snippet, an email list, or a piece of HTML and refine the expression until the highlights match what you expect.
Matching uses the browser’s JavaScript RegExp engine — the same rules as Node and front-end code. Other engines (PCRE, .NET, Python re, Go’s RE2) differ in corners, so the code panel flags the known gaps.
How it works
The tool builds a RegExp from your pattern and the selected flags. On every change it runs the expression against the test string. With the g flag it collects every match with String.prototype.matchAll; without g (even with y) it reports only the first match, which mirrors how RegExp.prototype.exec behaves once. An invalid pattern shows the browser’s error message next to the confused Kitto.
Highlights wrap each matched span in the sample text. Empty matches (patterns that can match zero characters) are marked so you can still see where the engine stopped. The search runs in a background thread (a Web Worker) with a 2-second time limit: if a pattern takes longer, it is stopped and a warning appears, so the tab never freezes. The match list is capped at 500 items.
The Code panel rewrites the pattern for each engine: named groups become (?P<name>…) in Python and Go, \u{…} becomes \x{…} where needed, [^] becomes [\s\S], and the pattern goes into the string form with the fewest escapes (raw strings, verbatim strings, backticks). What an engine lacks — lookarounds and backreferences in Go, variable-length lookbehind in Python and PHP, the y flag outside JavaScript — appears as a warning above the code.
Frequently asked questions
Is my pattern or text sent to a server?
No. Compiling the expression, finding matches, highlighting, and copying all happen on your device. Nothing is put in the URL or uploaded by this page.
Why do I only see one match?
Turn on the g (global) flag. Without it, JavaScript regex APIs return only the first match — the tester follows that rule so what you see matches how your code will behave.
Does this use the same regex as Python or PHP?
The tester runs the JavaScript engine, and most everyday patterns behave the same elsewhere. Pick your language under Code: it converts the syntax and warns about what does not carry over. Still confirm critical patterns in the language you ship.
What are capture groups?
Parentheses (…) store a piece of the match. Numbered groups appear as Group 1, Group 2, and so on; (?<name>…) shows as a named group. They are what $1 / match[1] / groups.name expose in code.
Can a bad pattern freeze my browser?
No. Very nested or ambiguous patterns, like (a+)+$, can take exponential time (catastrophic backtracking). Here the search runs in a Web Worker: after 2 seconds it is stopped and you see a warning, while the page stays responsive. If that happens, simplify the pattern; in production the same pattern could hang a server too.
Is an online regex tester safe for sensitive data?
On this page, content stays in the browser. Still avoid pasting real secrets on a shared computer; use anonymized samples when you can.