| . | Matches any character. |
| ^regex | Matches at the start point. |
| regex$ | Matches at the end point. |
| [abc] | Can match any character in the [] pair. Can match a or b or c. |
| [abc][xy] | Sets the definition, can match a or b or c followed by x or y. |
| [^abc] | When the ^ appears as the first character in square brackets, it negates the remaining patterns. This can match any character except a or b or c. |
| () | Specifies a group (subexpression) as if it were a single element in the pattern. For example ((a(b))c) will match b, ab, abc. |
| [a-d1-7] | Range: matches a string between a – d and the numbers 1 through 7 |
| X | Z | Finds X or Z. |
| XZ | Finds X followed by Z. |
| \d | Any number, short for [0-9] |
| \D | A non-numeric character, short for [^0-9] |
| \s | space character, short for [ \t\n\x0b\r\f] |
| \S | non-space character, short for [^\s] |
| \w | letter character, short for [a-zA-Z_0-9] |
| \W | non-letter character, short for [^\w] |
| \S+ | Some non-space characters (one or more). |
| \b | Characters in a-z or A-Z or 0-9 or _, short for [a-zA-Z0-9]. |
| * | Occurring 0 or more times, short for {0,}. For example A*B matches B, AB, AAB |
| + | Occurs 1 or more times, short for {1,}. For example A+B matches AB, AAB |
| ? | Occurs 0 or 1 times, ? is short for {0,1}. For example A?B will match B or AB. |
| {X} | Occurs X times. For example A{2} matches exactly the letter A |
| {X, } | Occurs X times or more. For example A{2} matches AA, AAA, AAAA … |
| {X,Y} | Occurs between X and Y times. For example A{2,4} matches AA,AAA,AAAA |
| *? | * means appears 0 or more times, adding ? after means finding the smallest match. |
| Character | Description |