+ Character Classes |
+
+ . | Any character except newline |
+
+
+ \w \d \s | Word, digit, whitespace |
+
+
+ \w \d \s | Word, digit, whitespace |
+
+
+ [abc] | Any of a, b, or c |
+
+
+ [^abc] | Not a, b, or c |
+
+
+ [a-f] | Character between a & f |
+
+
+ Anchors |
+
+ ^abc$ | ^ is the start of the string, $ end of string |
+
+
+ \b \B | Word, not-word boundary |
+
+
+ Escaped characters |
+
+ \.\*\\ | Escaped special characters |
+
+
+ \t\n\r | tab, linefeed, carriage return |
+
+
+ Groups & Lookaround |
+
+ (abc) | capture group |
+
+
+ \1 | Backreference to group #1 |
+
+
+ (?:abc) | Non-capturing group |
+
+
+ (?=abc) | positive lookahead |
+
+
+ (?!abc) | negative lookahead |
+
+
+ Quantifiers & Alternation |
+
+ a*a+a? | 0 or more, 1 or more, 0 or 1 |
+
+
+ a{5}a{2,} | exactly five a's, two or more a's |
+
+
+ a{1,3} | between one & three a's |
+
+
+ a+?a{2,}? | match as few as possible |
+
+
+ ab|cd | match ab or cd |
+
+
+