10 Basic cheatsheets for regular expression
19 | Pattern | Description |
20 | ------- | ------------------------------ |
21 | `.` | Any character, except newline |
27 | `\S` | Not whitespace |
28 | `[abc]` | Any of a, b, or c |
29 | `[a-e]` | Characters between `a` and `e` |
30 | `[1-9]` | Digit between `1` and `9` |
34 | Pattern | Description |
35 | ------- | ---------------- |
36 | `^abc` | Start with `abc` |
37 | `abc$` | End with `abc` |
39 ### Escaped characters
41 | Pattern | Description |
42 | ---------- | -------------------------------------- |
43 | `\. \* \\` | Escape special character used by regex |
46 | `\r` | Carriage return |
50 | Pattern | Description |
51 | ------- | ------------- |
52 | `(abc)` | Capture group |
56 | Pattern | Description |
57 | -------- | --------------------- |
58 | `a*` | Match 0 or more |
59 | `a+` | Match 1 or more |
60 | `a?` | Match 0 or 1 |
61 | `a{5}` | Match exactly 5 |
62 | `a{,3}` | Match up to 3 |
63 | `a{3,}` | Match 3 or more |
64 | `a{1,3}` | Match between 1 and 3 |