m = re.match(r"(\w+) (\w+)", "Isaac Newton, physicist") print(m.group(0)) print(m.group(1))
group(0) 是指匹配整个正则表达式的字符串,不一定是原始字符串
Sign in to make a reply
zx_sunrise
group(0) 是指匹配整个正则表达式的字符串,不一定是原始字符串