Regex Cheatsheet & Tester
Common regex patterns with a syntax reference — test them against your text.
- Runs in your browser
/[\w.-]+@[\w.-]+\.\w{2,}/gMatches most common email formats
0 matches
Regex syntax reference
.Any character (except newline)\dDigit (0-9)\wWord character (a-z, A-Z, 0-9, _)\sWhitespace (space, tab, newline)^Start of string/line$End of string/line*Zero or more+One or more?Zero or one (optional){n}Exactly n times{n,m}Between n and m times[abc]Character class (a or b or c)[^abc]Negated class (not a, b, or c)(abc)Capture group(?:abc)Non-capturing groupa|bAlternation (a or b)\bWord boundary\1Backreference to group 1Was this tool useful?