Regex Tester
Processed Client SideTest regular expressions against a string with live match highlighting. See every match numbered, with its position in the text.
Bookmark this tool now — skip the search next time you need it.
About Regex Tester
This tool runs entirely in your browser. Whatever you paste is processed on your own device and is never uploaded, logged, or sent to any server.
Build a regular expression and test it against real text with live highlighting, so you can see what your pattern actually matches instead of guessing. Every match is highlighted in the preview and listed underneath with its position in the string, numbered in order, so overlapping intent and greedy quantifiers become obvious immediately. All five JavaScript flags are one click away, an invalid pattern is reported as you type rather than silently matching nothing, and each match can be copied individually or all at once. It uses the browser regular expression engine, so what works here works identically in your JavaScript, Node, or TypeScript code.
Key features
- Live match highlighting inside the test string as you edit the pattern
- Numbered match list with the start and end index of every match
- All five JavaScript flags as toggles: g global, i case-insensitive, m multiline, s dot-all, u unicode
- Invalid patterns are flagged immediately with a clear error state, rather than quietly matching nothing
- Live match count, so you can tell "no matches" apart from "pattern is broken"
- Copy any single match, or copy all matches as a newline-separated list
- Uses the native browser regex engine — identical semantics to JavaScript and Node
- Runs entirely client-side, so you can test patterns against production log lines safely
How to use it
- Type your regular expression into the pattern field — without the surrounding slashes.
- Toggle the flags you need; g is what you want whenever you expect more than one match.
- Paste your test string into the pane below.
- Read the highlighted preview and the numbered match list with positions.
- Adjust the pattern until the highlighting matches your intent, then copy the matches or the pattern.
Tips & common mistakes
- Without the g flag you only ever get the first match. If your pattern looks right but only one result appears, that is why.
- Quantifiers are greedy by default: .* runs to the last possible match on the line. Add a question mark to make it lazy — .*? — when scraping between delimiters.
- Use m when ^ and $ should mean start and end of each line rather than of the whole string. Use s when you need . to cross newlines.
- Anchor with \b word boundaries instead of spaces when matching whole words, so a match at the start or end of the string is not missed.
- Escape the dot. An unescaped . matches any character, which is why an unescaped domain pattern matches far more than you expected.
- JavaScript regex has no free-spacing mode, so you cannot break a long pattern across lines with comments — build it up incrementally here instead.
- This engine is JavaScript. PCRE, Python, and Go differ on lookbehind support and named group syntax, so a pattern verified here still needs checking if it is destined for another language.
- Would rather describe the pattern with example strings than write regex syntax by hand? Try Regex From Examples.