Regex Tester
Write a pattern and watch every match light up as you type. Inspect capture groups, preview replacements, toggle flags, and keep the cheatsheet in reach. Uses the JavaScript engine — and never leaves your browser.
Cheatsheet · JavaScript flavour
Character classes
s)Anchors & boundaries
m)Quantifiers
Groups & references
Lookaround
Escapes
u: \u{1F600})How to use it
Type a pattern into the top field — no surrounding slashes needed, they're shown for you. Pick your flags with the toggle row, then type or paste text into the test area below. Every match is highlighted in place the instant you stop typing, alternating two colours so neighbours stay distinct, and the full list of matches with their capture groups appears underneath. The match counter shows how many were found.
Flags, briefly
The flags change how the whole pattern behaves. g (global) finds every match rather than stopping at the first — it's on by default here so you see all your matches. i makes matching case-insensitive. m (multiline) makes ^ and $ match at the start and end of each line instead of the whole string. s (dotall) lets . match newlines too. u enables full Unicode handling, including \u{…} escapes and correct treatment of emoji and other astral characters. y (sticky) anchors each match to exactly where the previous one ended.
Capture groups and replace
Parentheses create capturing groups, and each match in the list shows its groups numbered in order, plus any named groups you defined with (?<name>…). The optional replace field previews a substitution live: reference groups with $1, $2, the whole match with $&, and named groups with $<name>. Whether the replacement touches the first match or all of them depends on your g flag, exactly as it would in real code.
A note on zero-length matches
Some patterns match a position rather than a character — \b, ^, lookarounds, or anything quantified with * that can match nothing. These are real and useful, but they have no width, so the tool marks them with a thin caret in the text rather than a highlight block. The engine also steps past them safely, so a pattern like \b against a sentence won't hang the page.
Which flavour is this?
This tester uses your browser's built-in JavaScript (ECMAScript) regular-expression engine. That matters because regex dialects differ: features like possessive quantifiers, atomic groups, recursion, and the \A / \Z anchors exist in PCRE, Python, or Java but not in JavaScript, while JavaScript's named groups use (?<name>…) syntax. If a pattern you copied from another language doesn't behave as expected, a flavour mismatch is the usual reason. Everything you test here will behave identically in Node.js and in front-end JavaScript.
Privacy
Your pattern and your test text are processed entirely in your browser. Nothing is uploaded, stored, or logged — the tool works with no network connection at all.