正则_加号匹配一次或多从

import re

batRegex = re.compile(r'Bat(wo)+man')
mo1 = batRegex.search('the adventures of Batwoman')
print(mo1.group())

mo2 = batRegex.search('the adventures of Batwowowoman')
print(mo2.group())
结果是:
Batwoman
Batwowowoman

你可能感兴趣的:(正则_加号匹配一次或多从)