Regular Expression Syntax Quick Reference

PatternMatchesExample
\dAny digit 0-9\d{3} β†’ 123
\wWord character [a-zA-Z0-9_]\w+ β†’ hello
\sWhitespace\s+ β†’ spaces/tabs
.Any character except newline.+ β†’ anything
[abc]Character class[aeiou] β†’ vowels
^...$Start/end anchors^\d+$ β†’ digits only
(x|y)Alternation(cat|dog) β†’ cat or dog
x{n,m}Quantifier n to m times\d{2,4} β†’ 12, 123, 1234

Common Flags