11 Basic cheatsheets for regular expression
20 | Pattern | Description |
21 | -------- | ------------------------------------ |
22 | `.` | Any character, except newline |
28 | `\S` | Not whitespace |
29 | `[abc]` | Any of a, b, or c |
30 | `[a-e]` | Characters between `a` and `e` |
31 | `[1-9]` | Digit between `1` and `9` |
32 | `[^abc]` | Any character except `a`, `b` or `c` |
36 | Pattern | Description |
37 | ------- | ---------------- |
38 | `^abc` | Start with `abc` |
39 | `abc$` | End with `abc` |
41 ### Escaped characters
43 | Pattern | Description |
44 | ---------- | -------------------------------------- |
45 | `\. \* \\` | Escape special character used by regex |
48 | `\r` | Carriage return |
52 | Pattern | Description |
53 | ------- | ------------- |
54 | `(abc)` | Capture group |
58 | Pattern | Description |
59 | -------- | --------------------- |
60 | `a*` | Match 0 or more |
61 | `a+` | Match 1 or more |
62 | `a?` | Match 0 or 1 |
63 | `a{5}` | Match exactly 5 |
64 | `a{,3}` | Match up to 3 |
65 | `a{3,}` | Match 3 or more |
66 | `a{1,3}` | Match between 1 and 3 |