29 September 2020

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
CharacterMeaning
^
-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
CharacterMeaning
^
$
\dmatches any decimal digit
\Dmatches any non-digit
\w
\W
\smatches any whitespace character
\Smatches any non-whitespace character
\b
\B
Regexsese Metacharacters
CharacterMeaning
.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.