Regular Expressions
Raw Strings These cause escaped characters to be interpreted literally. They are VERY useful in Windoze becaue of the whack (\) that is used as a separator in file paths. They will also be useful in regular expressions. A raw string can be single or double quoted and it can be a triple-quoted multiline string as well.
Characterclassese This is the language of character wildcards.
Characterclassese Metacharacters | |
---|---|
Character | Meaning |
^ | |
- | This is used to indicate a range. |
[ | This begins a list character class |
] | This ends a list character class |
\ | This toggles magic |
These can include specific characters or an asciicographical range. They go inside of square brackets.
Regexese This is the language that character wildcards into specifications of textual patters.
Juxtaposition "and then immediately"
Special Character Classes | |
---|---|
Character | Meaning |
^ | |
$ | |
\d | matches any decimal digit |
\D | matches any non-digit |
\w | |
\W | |
\s | matches any whitespace character |
\S | matches any non-whitespace character |
\b | |
\B |
Regexsese Metacharacters | |
---|---|
Character | Meaning |
. | Matches any character but a newline (\n) |
^ | beginning of line |
$ | end of line |
+ | |
? | |
{ | |
} | |
[ | |
] | |
\ | |
| | |
( | |
) |
Regexes are used in many different computer languages, inclduding JavaScript, Python, and Java.