Regex Tester

Test and debug regular expressions: live highlighting, a match list with positions and lengths, and full capture-group extraction.
All processing happens locally in your browser — your data is never uploaded to any server.
Pattern:
Template: Selecting a template fills the pattern box and runs the test.
Matches will be highlighted here.
Match List
# Matched text Position Length Capture groups
How to use — Type a pattern in the Pattern box (or pick one from the Template dropdown) and enter test text. Results update live.
Flags: g = find all matches, i = ignore case, m = ^/$ match per line, s = dot matches newline, u = Unicode mode.
The preview highlights every match in yellow. The table below lists each match with its position and length, plus every capture group ($1, $2, …).
Zero-width matches (e.g. a* on "bbb") are handled safely — they cannot hang the browser. Invalid patterns show an inline error instead of a dialog.
Press Ctrl+Enter to run. All data is processed locally — nothing is uploaded.
Regular expressions in one minute

Most regex characters are metacharacters with special meaning — . ^ $ * + ? ( ) [ ] { } | \ — and a backslash makes them literal again. Anchors ^ and $ match positions rather than characters, and the quantifiers * and + are greedy by default: they grab as much as they can, while the lazy forms *? and +? settle for the shortest match.

When a pattern matches too much, the fix is usually a lazy quantifier or a negated character class — not more . characters.