代码实例 import re def match(x, pattern): # 匹配字符串,如果包含则返回True answer = pattern.search(x) if answer == None: return False else : re