How to test a regular expression
Type your pattern in the slashes at the top and paste the text you want to match into the left pane. As you type, every match is highlighted in the output on the right and listed underneath with its position and any capture groups, with the total count shown live. There is no run button and no delay — each keystroke re-evaluates instantly. Toggle the flags to change behaviour, switch to Replace mode to rewrite the text, and use Load sample for a ready-made example to explore.
If your pattern is not yet valid — say you are mid-way through typing a character class — the status line shows the exact error the JavaScript engine reports, rather than silently failing. That makes the tool a quick way to debug a regex, not just run it.
What each flag does
JavaScript regular expressions take a set of single-letter flags that change how matching works, and seeing them toggle live is the fastest way to understand them. g (global) finds all matches instead of stopping at the first. i makes matching case-insensitive. m (multiline) makes the anchors ^ and $ match at the start and end of each line rather than the whole string. s (dotAll) lets . match newline characters too. u (unicode) enables full Unicode handling, which you need for astral-plane characters and \p{…} property escapes. y (sticky) anchors each match to the engine's lastIndex, so matches must be contiguous from where the previous one ended.
Capture groups and references
Parentheses in a pattern create capture groups that pull out the parts you care about. This tester lists each numbered group ($1, $2, …) for every match, and supports named groups written (?<year>\d{4}), showing them by name. Non-capturing groups (?:…), lookahead (?=…)/(?!…) and lookbehind (?<=…)/(?<!…) all behave as in standard JavaScript. Inspecting the groups is usually how you confirm a pattern is extracting exactly the right slices of text before you wire it into code.
Find and replace with backreferences
Switch to Replace mode and a second field appears for the replacement string. It uses the same syntax as JavaScript's String.prototype.replace: $1 inserts the first capture group, $<name> a named group, $& the whole match, and $$ a literal dollar sign. The rewritten text appears live, so you can craft a transformation — reformatting dates, masking digits, reordering name parts — and verify it against real input before trusting it in a script or editor.
Why a local regex tester matters
Regex work almost always involves real data: you paste in a sample of production logs, a customer export, an email dump or a config file to make sure the pattern matches what it should and nothing it should not. Pasting that into an online tester sends it to someone else's server, and pasting it into an AI assistant means it may be retained or used for training — neither is appropriate for data that is sensitive or simply not yours to share. Because this tester uses the browser's own RegExp engine entirely in your tab, your text never leaves the device. It is also exact: the same engine your code will run, so what matches here matches in production — no approximation, no model guesswork.
- Live highlighting, match list, group capture and count.
- All flags — g, i, m, s, u, y — toggled in real time.
- Named & numbered groups, lookaround, the full JS flavour.
- Replace mode with
$1/$<name>/$&backreferences. - Local — test against real logs and data with nothing uploaded.
Frequently asked questions
- Which regex flavour is this?
- JavaScript (ECMAScript) — the same engine as Node.js. Lookbehind, named groups and
\p{…}all work. - Is my test data uploaded?
- No. The pattern and text run in the browser's
RegExpengine locally; nothing is sent to a server. - What do g, i, m, s, u, y mean?
- Global, case-insensitive, multiline anchors, dotAll, full-Unicode, and sticky respectively — toggle to see each live.
- Can it find and replace?
- Yes — Replace mode supports
$1,$<name>and$&backreferences, with live output.