Regex Tester

Test regular expressions against sample text — 100% in your browser, nothing leaves your machine

//gi
2 matches
TEST STRING149 chars
HIGHLIGHTED MATCHES
Contact us at hello@example.com or support@example.org. Call (555) 123-4567 or (555) 987-6543 for help. Visit https://example.com/docs for more info.
MATCH DETAILS
#1index 14hello@example.com
#2index 35support@example.org

Frequently Asked Questions

g (global) makes the regex find every match in the text instead of stopping after the first one. i (ignore case) makes the match case-insensitive. m (multiline) changes ^ and $ to match the start and end of each line rather than just the start and end of the whole string. s (dot all) makes . match newline characters too, which it normally doesn't.
Yes. This runs entirely in your browser using JavaScript's native RegExp, so it matches exactly what you'd get in browser JS or Node.js. That matters because regex syntax isn't fully universal — features like named groups, lookbehind, and Unicode property escapes vary between JavaScript, Python (re), and PCRE, so a pattern that works here may need small tweaks to run in another language.
The most common cause is forgetting the g (global) flag. Without it, JavaScript's regex methods stop after the first match. Check the g checkbox above and the tool will find every occurrence in the test string.
Characters like . * + ? ( ) [ ] { } | and \ are special in regex syntax — they control matching behavior rather than representing themselves. To match one of them literally, escape it with a backslash, e.g. use \. to match an actual period instead of "any character."
Common uses include validating input formats like email addresses and phone numbers, extracting specific pieces of data (like dates or URLs) out of a larger block of text, and powering find-and-replace operations that need to match a pattern rather than an exact string.