Essential Regular Expression patterns and syntax for developers
\dAny digit (0-9)\wAny word character (a-z, A-Z, 0-9, _)\sAny whitespace (space, tab, newline).Any character except newline[abc]Any character in the set (a, b, or c)[^abc]Any character NOT in the set*0 or more occurrences+1 or more occurrences?0 or 1 occurrence{n}Exactly n occurrences{n,}n or more occurrences{n,m}Between n and m occurrences^Start of string/line$End of string/line\bWord boundary\BNon-word boundary(abc)Capture group(?:abc)Non-capturing group(?=abc)Positive lookahead(?!abc)Negative lookahead^[\w-\.]+@([\w-]+\.)+[\w-]{2,4}$Email Address^(https?:\/\/)?([\da-z\.-]+)\.([a-z\.]{2,6})([\/\w \.-]*)*\/?$URL^#?([a-fA-F0-9]{6}|[a-fA-F0-9]{3})$Hex Color Code^\d{4}-\d{2}-\d{2}$Date (YYYY-MM-DD)Test your regular expressions in real-time with our interactive tool. Visual highlighting and pattern explanations included.
Try Tool →A comprehensive tutorial on mastering regular expressions. Learn from basics to advanced lookarounds and optimization.
Read Article →