Test String
Results
Regex Cheat Sheet
Character Classes
.Any character except newline\dDigit (0-9)\DNot a digit\wWord character (a-z, A-Z, 0-9, _)\WNot a word character\sWhitespace (space, tab, newline)\SNot whitespace[abc]Any of a, b, or c[^abc]Not a, b, or c[a-z]Character range a to zAnchors
^Start of string (or line with m flag)$End of string (or line with m flag)\bWord boundary\BNot a word boundaryQuantifiers
*0 or more+1 or more?0 or 1 (optional){n}Exactly n times{n,}n or more times{n,m}Between n and m times*?Non-greedy (lazy) matchGroups & References
(abc)Capturing group(?:abc)Non-capturing group(?<name>)Named capturing group\1Backreference to group 1a|bMatch a or b (alternation)Lookahead & Lookbehind
(?=abc)Positive lookahead(?!abc)Negative lookahead(?<=abc)Positive lookbehind(?<!abc)Negative lookbehindCommon Patterns
\d+One or more digits\b\w+\bHighlight words\w+@\w+\.\w+Simple emailhttps?://\S+URL\d{3}-\d{4}Phone (xxx-xxxx)^.{8,}$At least 8 charactersAbout Regex Tester
This tool uses JavaScript's RegExp engine.
Remember to escape special characters like . * + ? ( ) [ ] { } \ ^ $ | with a backslash when you want to match them literally.
Regex Tester