匹配小括号中的内容 import re string = 'shain(love)fufu)' p1 = re.compile(r'[(](.*?)[)]', re.S) #最小匹配 p2 = re.compile(r'[(](.*)[)]', re.S