1.首先导入模块import re2.匹配多种可能 使用 []#'run' or 'ran'res = re.search(r'r[au]n','dog runs to cat')print(res)>>> 3.匹配数字 d and D# d : decimal digit 数字的res = re.search(r'rdn','run r9n')print(res)>>> # D : any non-decimal digit 任何不是数字的res = re.search(r'rDn','run r9n')print(res)>>> 4.匹配空白 s and S# s : any white space [ f v]res = re.search(r'rs