...

/

Python Regular Expression Patterns List

Python Regular Expression Patterns List

Learn about the Python REGEX symbols

We'll cover the following...

The following table lists the regular expression syntax that is available in Python. Note that any Regex can be concatenated to form new regular expressions; if X and Y are both regular expressions, then XY is also a regular expression.

Pattern Description
. Matches any single character except newline. Using m option allows it to match newline as well.
^ Matches the start of the string, and in re.MULTILINE (see the next lesson on how to change to multiline) mode also matches immediately after each newline.
$ Matches end of line. In re.MULTILINE mode also matches before a newline.
...