Regex Tester
Write and test regular expressions against sample text in real-time. See matches highlighted, inspect capture groups, and get flags control.
Why use a Regex Tester?
Regular expressions are powerful but notoriously difficult to write correctly without immediate feedback. A real-time tester lets you see exactly which parts of your test string match as you type, including capture group contents. This eliminates the debug-deploy cycle when writing input validation, log parsing, or data extraction patterns. Pair it with the text diff tool and case converter in the developer tools suite.
Live highlighting
Matches are highlighted in yellow as you type your pattern — no submit button needed — making iterative refinement instant.
Capture group display
Named and numbered capture groups are listed separately so you can verify each group extracts exactly the right substring.
Flag controls
Toggle global, case-insensitive, multiline, and dotAll flags individually to see how each changes the match results.
Common regex patterns
These battle-tested patterns cover the most common validation and extraction tasks. Copy and adapt them in the tester above.
| Pattern | Regex | Notes |
|---|---|---|
| Email address | [a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,} | Basic validation — use HTML5 type="email" for forms |
| URL (http/https) | https?://[^\s/$.?#].[^\s]* | Matches http and https URLs in plain text |
| IPv4 address | \b(?:\d{1,3}\.){3}\d{1,3}\b | Matches the pattern — does not validate octet ranges (0–255) |
| Date (YYYY-MM-DD) | \d{4}-(?:0[1-9]|1[0-2])-(?:0[1-9]|[12]\d|3[01]) | ISO 8601 date format with month/day range validation |
| Phone (US) | (?:\+1[-.\s]?)?\(?\d{3}\)?[-.\s]?\d{3}[-.\s]?\d{4} | Handles common US phone number formats with optional country code |