有人可以告诉我为什么我的模式:<p(\s+(.*)?)?>(.[^</p>]*)?</p>
不能正常工作。示例匹配:
<p>This is a test and anything can be here even other <tags>tags</tags></p>
<p style="test">This is a test</p>
<p></p>
如果以上都在一行上,它应该找到 3 个单独的模式。下面的链接展示了它的真实行为,这很奇怪......
它找到的匹配项应始终在找到时立即开始,并在找到<p
时立即停止</p>