Test regular expressions in real time. See matches highlighted and capture groups extracted. 100% client-side.
[a-zA-Z0-9._%+-]+@...https?://...\\b\\d{1,3}\\.\\d{1,3}...\\b\\d{4}[- ]?\\d{4}...^(?=.*[a-z])(?=.*[A-Z])...(\\d{3})[- ]?(\\d{3})...#([0-9a-fA-F]{3}){1,2}\\b\\d{5}(-\\d{4})?\\bType or paste your regular expression into the pattern field between the two forward slashes. Add flags in the box to the right — the most common are g (global, find all matches), i (case-insensitive), and m (multiline, makes ^ and $ match line boundaries). Then paste your test string in the left panel — matches are highlighted in amber in the right panel instantly as you type.
If your pattern contains capture groups using parentheses, a table below the editor will show each group's extracted value for every match. This is especially useful when you need to pull specific parts out of a string, such as extracting the domain from an email address or the year from a date.
The clickable pattern library above covers the most frequently needed patterns, but here are a few more worth knowing. To match any digit, use \d; for any word character (letter, digit, underscore), use \w; for whitespace, use \s. The dot . matches any character except a newline. Anchors ^ and $ assert the start and end of a line. Quantifiers like + (one or more), * (zero or more), and {2,5} (between 2 and 5 times) control repetition.
Regex excels at three tasks: validation (does this string match a format?), extraction (pull specific parts out of a string), and replacement (find and replace with complex rules). Common real-world uses include validating form inputs like emails, phone numbers, and postal codes; scraping structured data from log files or HTML; and performing bulk find-and-replace operations in code editors. Regex is available natively in JavaScript, Python, Ruby, Go, Java, PHP, and virtually every other language.
Build your pattern incrementally — start with the simplest possible match and add complexity one piece at a time. Always test against both valid inputs you want to match and invalid inputs you want to reject. Watch out for catastrophic backtracking: deeply nested quantifiers like (a+)+ can cause exponential execution time on certain inputs. The execution time shown below the pattern field will alert you to patterns that run slowly.