Regex, short for Regular Expressions, is a powerful system for searching text. Regular expressions are implemented in a variety of languages including java and python.
In Python, regular expressions are available through the
The following are some of the regular expression operations:
- Represents a character class that includes all digits (0-9). The inverse of this class is designated with a capital, &bsop;D, and will match any character that is not a digit.
- Iterates over a string to find a subset of characters that match a specified pattern. It will return a list of every match that occurs in a given string.
- Iterates over a string to find a subset of characters that match a specified pattern.
- Divide a string into substrings at each occurrence of the specified character(s). This method is a good alternative to the default python .split() for instances that require matching multiple characters.
- Replace matching substrings with a new string for all occurrences, or a specified number.