Symbol | Function | Example | Explanation |
* | Zero or more | ab*c | The letter "a" followed by zero or more "b"s followed by a "c" |
+ | One or more | ab+c | The letter "a" followed by one or more "b"s followed by a "c" (this is equivalent to abb*c) |
? | Zero or one (i.e., optional) | abc? | The letters "ab" optionally followed by one "c" |
{n} | Exactly n | (abc?){4} | Four repetitions of either "ab" or "abc" (can be mixed) |
{n,} | n or more | a{4,}bc | At least four "a"s followed by "bc" |
{n,m} | At least n and no greater than m | ab*c{3,152} | The letter "a" followed by 0 or more "b"s followed by anywhere from 3 to 152 "c"s |
\s | Any whitespace (currently only includes the space character, since no allowed alphabets include any other whitespace characters |
\w | Any letter, number, or underscore |
\d | Any digit |
\S \W \D | The complements of the above character classes |
[a-h] | The square brackets enclose a list of character classes, which can include letter/number ranges |
[^abc0-5] | Opening the square brackets with a "^" negates the class - so this class is all characters except for "a","b","c","0","1","2","3","4", and "5" |
a[^b]+c | Bracket-classes (and backslash classes) can be treated as a single character - this regex matches the letter "a" followed by one or more non-"b" characters, followed by a "c" |