(|): Matches multiple regular expression modes. At | home matches at and home
(.): Match any single character. F. o matches any character between f and o, such as foo, f # o
(^/$/\ B/\ B): ^ matches the string starting from the start, $ or \ Z matches the end of the string, and \ B indicates the boundary of the word, \ B indicates that it is not the boundary of a word, for example, a string starting with "From", a string ending with "hi", ^ Subject: hi $ matches a string consisting of only Subject: hi, \ bthe matches a string starting with the, \ bthe \ B matches only the, \ Bthe matches a string that contains the but does not start with.
([]): Character class, B [aeiou] t matching bat, bet, bit, bot,
(-): The specified range is [0-9]. The value ranges from 0 to 9.
(^): No: [^ aeiou] matches non-Vowel characters
(*, + ,?, {}): Multiple occurrences/repeated matches
Special Character and Character Set: \ d represents a decimal number, \ w represents the character set of the entire character number (A-Za-z0-9), \ s represents a blank character, uppercase character represents mismatch, \ D indicates a non-decimal number
Common functions:
Re. match (pattern, string, flags = 0): Start from the first character for pattern matching.
Re. search (pattern, string, flags = 0): search mode from left to right.
Re. findall (partten, string): Find the matching part for each occurrence.
Re. sub (partten, str, string): Find the matching string in the string, change it to str, and return.
Re. split (partten, string): Find the string that matches the pattern, and split the string by its.
Note:
(): Group partten to make it easy to retrieve (group/groups) after matching ).