我在Python中有一个正则表达式:
p = re.compile("<" + tag + ">([aA-zZ0-9\-\s:]*)</" + tag + ">")
而且我似乎无法让它在这个字符串中找到两个匹配项(其中标记是'unique')
<unique>UNIQUE Passive - Maim:</unique> Basic attacks deal 10 bonus magic damage to monsters on hit.<br><unique>UNIQUE Passive - Butcher:</unique> Damage dealt to monsters increased by 10%.<br><br><i>ique Passives with the same name don't stack.)</i>
你知道为什么它只和第一个匹配吗?你知道吗
如果您使用p.search,请使用findall或finditer代替它。你知道吗
输出:
相关问题 更多 >
编程相关推荐