Regex Tester
Live matching, highlight, capture groups, and replace — client-side.
Pattern
Flags
Mode
Replacement
matches
—
About regex testing
Regular expressions are the standard tool for validating input, extracting substrings, and rewriting text — and the fastest way to get them right is to iterate live against real samples. This tester runs JavaScript's native RegExpengine in your browser: type a pattern, watch matches highlight as you type, inspect capture groups, and flip to replace mode to see a rewrite applied.
Flag reference
The checkboxes toggle JavaScript's standard RegExp flags:
gglobal —- finds every occurrence in the text. Without it, replace mode only rewrites the first match.
iignore case —- letter case no longer matters — /hello/i matches "Hello" and "HELLO".
mmultiline —- the ^ and $ anchors match at the start/end of every line, not just the whole string.
sdot all —- the dot also matches newline characters, so patterns like .+ can span multiple lines.
uunicode —- full Unicode semantics — emoji and other astral characters are treated as single characters, and \u{1F600}-style code point escapes work.
ysticky —- matches are anchored to the exact current position (lastIndex) — mainly useful for tokenizers.
Zero-width matches
A pattern like a* can match an empty string, which on many sites makes a regex tester hang or flood the page with zero-width results. This tool advances past zero-width matches automatically and skips them in the highlight, so you can experiment freely with quantifiers like* and ?.
Related tools
Validate the result against structured data with the JSON formatter, or build a reusable config in the JSON to YAMLconverter.
FAQ
Can regex testing hang my browser?
No. Patterns that can match empty strings (like /a*/g) are handled with a guard that advances past zero-width matches, and the tool caps runaway matching.
Is my pattern or text sent anywhere?
No. Matching uses native JavaScript RegExp entirely in your browser — nothing is uploaded.
What do the flags mean?
They toggle standard JavaScript RegExp options: g (global) finds all matches, i ignores case, m makes ^ and $ match line boundaries, s lets . match newlines, u enables full Unicode semantics, and y anchors matching to the current position.