正则

匹配括号不包活小括号()

contacts=re.findall(r'(?<=\()[^\(\)]*(?=\))',xinxi, re.I)

匹配邮箱

 mail_pattern = re.compile(
                    r'(?<=[\s::\<\(\>])[0-9a-zA-Z_\.\*-]{1,50}@[0-9a-zA-Z-\.]{1,50}\.[a-zA-Z0-9]{1,10}', re.I)

你可能感兴趣的:(正则表达式)