Regular Expression Tester
Test and debug regular expressions against any text. Highlights all matches, shows capture groups and flags. JavaScript regex engine. Free.
How to use the Regex Tester
JavaScript regex engine
Enter your pattern without the surrounding /slashes/. Use flags: g (find all), i (case insensitive), m (multiline — ^ and $ match line starts/ends), s (dot matches newlines). All matches are highlighted inline in the test string.
Common patterns
Email: [a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,} — URL: https?://\S+ — UK postcode: [A-Z]{1,2}\d[A-Z\d]? ?\d[A-Z]{2} — 5-digit ZIP: \d{5} — any word 5+ letters: [a-zA-Z]{5,}
Regular expressions were invented by mathematician Stephen Cole Kleene in 1951 — long before computers were widely available. The original concept was about formal languages, not text searching. Modern 'regex' is a much more expansive (and less mathematically pure) descendant.