Free online tool
Free Online Regex Tester — Live Match Highlighting
Test regular expressions in your browser. Live match highlighting, capture groups, named groups, and replacement preview. Supports all modern JS regex flags. 100% client-side — your patterns and test strings never leave your browser.
Regex cheat sheet
\dAny digit\wAny word character (a-z, A-Z, 0-9, _)\sAny whitespace character.Any character except newline^Start of line$End of line[a-z]Character range(abc)Capture group(?:abc)Non-capturing group{n,m}Repeat n to m times01How it works
Enter your pattern and flags
Type a regex pattern in the first field (no slashes needed). Toggle flag buttons for g, i, m, s, u, y or type them directly. Matches update in real time as you type.
Paste your test string
Paste the text you want to test against. Matches are highlighted inline and listed below with index, full match, capture groups, and named groups.
Preview replacements (optional)
Enter a replacement string — supports $1, $2 for numbered groups and $<name> for named groups. The full replaced output is shown instantly below the match list.
FAQ
Frequently asked questions
Which regex features are supported?
This tool uses JavaScript's native RegExp engine — the same one your browser runs. It supports ES2018+ features including lookbehinds (?<=...) and (?<!...), named capture groups (?<name>...), Unicode property escapes (\p{L}), the s (dotAll) flag, the d (indices) flag, and the y (sticky) flag. It does NOT support PCRE-specific extensions like \K, possessive quantifiers, or atomic groups — those are a different engine. If your regex works in Node.js or Chrome DevTools, it will work here.
What is catastrophic backtracking and how does this tool handle it?
Catastrophic backtracking happens when a regex with nested quantifiers — like (a+)+$ — tries exponentially many paths on a non-matching input, causing the engine to hang. This tool detects it: if the match loop takes longer than 500 ms, it aborts with an error rather than freezing your browser tab. To fix backtracking patterns, use possessive quantifiers or atomic groups if your engine supports them, or restructure the pattern to avoid nested repetition over the same characters.
Why does the tool work even when I omit the g flag?
The g (global) flag is required internally because the tool uses matchAll to collect all matches. If you omit g, the tool adds it automatically for matching purposes — your displayed flags are unchanged. The result is the same as if you had included g: you get every match in the test string, not just the first.
Are my regex patterns or test strings uploaded anywhere?
Nothing. All processing runs in your browser's JavaScript engine. Your regex patterns, test strings, and replacement templates are never sent anywhere — no server, no analytics, no logging. You can verify this by opening DevTools → Network while the tool runs: no requests are made.
Need AI-powered document extraction?
This tool uses client-side processing. anyrow uses AI to extract structured data from PDFs, images, and scanned documents with 99% accuracy. 150 free extractions/month — no credit card required.