Regex Tester
Test and debug regular expressions with live highlighting. See matches in real-time, capture groups, and use common pattern presets.
Advertisement
Secure & Private Client-Side
This tool runs entirely in your browser. No data is sent to any server, ensuring your information remains private and secure.
About Regex Tester
Test and debug regular expressions with live highlighting. See matches in real-time, capture groups, and use common pattern presets.
Advertisement
Frequently Asked Questions
What regex features are supported? expand_more
We support JavaScript regular expressions including all standard regex flags (g, i, m, s, u, y) and syntax.
Can I see all matches? expand_more
Yes! When you use the global (g) flag, all matches are highlighted and displayed with their positions and captured groups.
Do you have common patterns? expand_more
Yes! We include a library of common patterns for email, URLs, phone numbers, dates, credit cards, and more to help you get started.
What do regex flags do? expand_more
Flags modify matching: g (global, find all), i (case-insensitive), m (multiline), s (dotall), u (unicode), and y (sticky). Toggle flags in our [Regex Tester](/tools/regex-tester/) to see effects.
How do I use capture groups? expand_more
Parentheses () create capture groups. For example, /(www.)?([^/]+)/ captures domain separately. Our [Regex Tester](/tools/regex-tester/) displays all capture groups below matches.
What are character classes like [a-z]? expand_more
Character classes match any single character in the set. [a-z] matches any lowercase letter, [0-9] matches any digit, and [^abc] matches anything EXCEPT a, b, or c.
How do I validate email with regex? expand_more
Use our "Email" preset or /^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+.[a-zA-Z]{2,}$/ to match valid emails. Test with both valid and invalid inputs in our [Regex Tester](/tools/regex-tester/).
Why does my regex match too much? expand_more
Common causes: missing anchors (^ for start, $ for end), using . (which matches anything) instead of . (literal dot), or not using quantifiers correctly. Use highlighting in our [Regex Tester](/tools/regex-tester/) to identify scope.
Advertisement