See exactly what your pattern matches
Type a regular expression and some test text, and every match is highlighted as you type. The results table lists each match with its position and all capture groups, including named groups like (?<year>\d{4}). Toggle flags — global, ignore case, multiline, dot-all, unicode and sticky — with one click.
Switch to Replace mode to preview substitutions using $1, $<name> and $&. Patterns run in a background thread with a time limit, so a runaway pattern (catastrophic backtracking) is stopped instead of freezing your browser. Common patterns for emails, URLs, US phone numbers, ZIP codes, dates and IP addresses are one click away.
How to test a regular expression
- 1
Enter the pattern
Or pick a common pattern; /pattern/flags literals are accepted too.
- 2
Choose flags
g, i, m, s, u or y.
- 3
Add test text
Matches highlight instantly.
- 4
Try a replacement
Preview the result with group references.
Key features
Live highlighting
Alternating colors make adjacent matches easy to tell apart.
Groups table
Numbered and named capture groups for every match.
Replace preview
Supports $1, $<name> and $&.
Freeze-proof
Slow patterns are stopped after 1.5 seconds.
Common uses
- Form validation: Check patterns for emails, phone numbers and ZIP codes.
- Log parsing: Extract IDs, timestamps and error codes.
- Bulk edits: Test a find-and-replace before running it on a codebase.
Tips and good to know
- Nested quantifiers like
(a+)+can take exponentially long on non-matching text. Keep patterns specific. - The engine is JavaScript's, so results match Node.js and browsers. Other languages differ slightly, for example in lookbehind support.
- Need to see a URL's parts instead of regex-matching them? Try the URL Parser.
