I. Regular expressions commonly used in PythonTwo. Regular Expression Web site, can be online regular matchhttps://regex101.com/1. How to use and the regular introduction1 "." Matches any character that is any other than the line break (\ n)' * ' matches a previous character 0 or more times2 "\b Matching digital 0-93 "\d match non-digital [^\b]4 "\s match space character5 "\s matches non-whitespace characters [^\s]*6> \w Match word character [A-z] [a-z][0-9]7> \w matches non-word characters [^\w]9* Match the previous character 0 or unlimited times 10 "? Match the preceding character 0 or 1 times11 "{m} matches the previous character m times12 "{M,n} matches the previous character m times to N timesboth M and n can be omitted, and if the province is M, it will match the previous character 0 times to N timesif n is omitted, it matches m to infinityOmit M:{0,n}omit n:{m,0}. Match m times to Infinite times12 "^ with what what start 13 "$ with what what end14 "| Represents an arbitrary match between the left and right expressions. It is always too often to try to match the expression on the left, once successfula successful match skips the right expression. If | is not included in the (), then its scope is the entirethe regular expression. 15 "(...) The enclosed expression will be grouped, starting from the left side of the expression, each encounter a grouped leftbrackets ' (', number +1. In addition, the grouping expression as a whole can be followed by the number of words. TableThe | In-style | is only valid in this group. 16. Grouping of regular Expressions(? P<name>, ...) Group, specifying an additional alias in addition to the original number\<number> refers to a string that is matched to a group that is numbered <number>. (? P=name) refers to the string that the alias of <name> is matched to.
Python base 8.0 regex regular Expressions-common regular expressions