Regex Tester
Write a pattern, paste some text, see every match and capture group instantly — plus a replace preview, using the exact regex engine your browser runs.
Test a pattern
Nothing leaves your deviceEnter a pattern and some test text — matches and capture groups appear here live.
How to use this regex tester
- Write your pattern without the surrounding slashes — just the inside part.
- Set the flags:
gfor every match,ifor case-insensitive,mfor multiline anchors,sso dots match newlines. - Paste your test text. Results update as you type: match count, positions, matched text and each capture group.
- Try replacements by filling “Replace with” — the preview shows the transformed text, with
$1,$2referencing groups.
Useful information
Regular expressions are a compact language for describing patterns in text. This tester runs the ECMAScript engine — the same one behind String.match(), replace() and search() in your browser — so results transfer directly to your code.
Reading the results
Each row shows where the match started and what it captured. Group 1 comes from the first (…) in your pattern, group 2 from the second, and named groups appear with their names. A match list is often the fastest way to see why a pattern isn't behaving.
Common gotchas
The dot never matches newlines (use the s flag). ^ and $ anchor to the whole string unless you add m. Quantifiers are greedy by default — append ? (as in .*?) to make them lazy. And a pattern that can match an empty string will step one character at a time, which is why matches here are capped at 200.
Escaping in real code
What you type here is the raw pattern. In a JavaScript string literal you'd double the backslashes ("\\b\\w+"), while in a regex literal you'd write /\b\w+/. Everything between the slashes is exactly what belongs in the pattern box.
Frequently asked questions
Which regex syntax does this tester support?
JavaScript regular expressions (ECMAScript) — the exact same engine your browser runs. Classes, quantifiers, groups, named groups (?<name>…), lookarounds and Unicode property escapes all work.
What do the flags mean?
g finds every match instead of the first, i ignores case, m makes ^ and $ match line starts and ends, s lets the dot match newlines, and u enables full Unicode mode.
Why doesn't my pattern match across lines?
By default the dot doesn't match newline characters. Add the s flag to let it, use m for line-anchored matching, or match explicitly with [\s\S] patterns.
How many matches are shown?
Up to 200 matches are collected so a greedy pattern can't hang the tab, with the first 30 displayed in detail plus capture groups for each.
Is my text stored anywhere?
No. Matching runs entirely in your browser — patterns and test text are never sent to a server or saved by Jivora.