Free Regex Tester
Debug regular expressions with instant visual feedback. Type your pattern, paste test text, and watch every match highlight live — with capture groups listed, flags explained, and syntax errors reported the moment they happen.
Pattern error
Highlighted matches
How to Use the Regex Tester
- Type your regex pattern (without the surrounding slashes).
- Toggle flags: global, case-insensitive, multiline.
- Paste test text — matches highlight live as you type.
- Inspect the match list with positions and capture groups.
Features
Matching is live and debounced: every keystroke recompiles the pattern and re-highlights the test text with tags. The match panel lists each match with its index and all capture groups, zero-length matches are handled safely, and invalid patterns show the engine’s exact error message instead of failing silently. Flags g/i/m/s are toggleable with plain-English labels.
Benefits & Use Cases
Developers iterate on validation patterns and log-parsing expressions in seconds instead of console-logging in a REPL; QA engineers verify patterns against real data samples; students see immediately what each tweak changes. Local execution means proprietary log data stays private.
Tips
Build the pattern incrementally: get a simple version matching first, then add complexity. If matches highlight unexpectedly, check greedy quantifiers — try the lazy *? form. For catastrophic slowness, avoid nested quantifiers like (a+)+.
Frequently Asked Questions
What do the regex flags mean?
g (global) finds all matches instead of stopping at the first; i makes matching case-insensitive; m makes ^ and $ match line boundaries; s lets . match newlines too.
Why is my pattern showing an error?
The most common causes are unbalanced parentheses or brackets, a trailing backslash, or an invalid quantifier like {2,1}. The error message names the exact problem.
What are capture groups?
Parentheses ( ) create groups that “capture” the text they match. This tool lists each group’s content per match — useful for extracting parts like area codes from phone numbers.
Why does my pattern match empty strings?
Patterns like a* can match zero characters, producing zero-length matches. This tester shows them safely without hanging, and you usually want a+ (one or more) instead.
Is my test text uploaded anywhere?
No. Compilation and matching run entirely in your browser — your patterns and test data never leave your device.
Related Tools
Regex Generator
Build regex patterns visually with NToolHub’s free generator. Token builder, presets, plain-English explanation — no regex PhD needed.
Open tool →Regex Escape
Escape special regex characters instantly with NToolHub’s free tool. Safe literal matching, unescape mode — fast and private.
Open tool →JavaScript Formatter
Beautify minified JavaScript with NToolHub’s free formatter. Smart brace indentation, string-safe — readable code instantly, 100% private.
Open tool →URL Encode
Percent-encode URLs and text instantly with NToolHub’s free tool. Component or full-URL mode, UTF-8 safe — private in-browser.
Open tool →