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

Private by design. This tool runs 100% in your browser — your code is never uploaded to any server.

How to Use the Regex Tester

  1. Type your regex pattern (without the surrounding slashes).
  2. Toggle flags: global, case-insensitive, multiline.
  3. Paste test text — matches highlight live as you type.
  4. 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