📅  最后修改于: 2022-03-11 14:45:46.887000             🧑  作者: Mango
import re
= re.sub(, new, text, count=0) # Substitutes all occurrences with 'new'.
= re.findall(, text) # Returns all occurrences as strings.
= re.split(, text, maxsplit=0) # Use brackets in regex to include the matches.
= re.search(, text) # Searches for first occurrence of the pattern.
= re.match(, text) # Searches only at the beginning of the text.
= re.finditer(, text) # Returns all occurrences as match objects.