如何匹配以下模式:
<aaa class = "dog">
<bbb id = "one"/>
</aaa>
<aaa class = "dog">
<bbb id = "two"/>
</aaa>
<aaa class = "dog">
<bbb id = "three"/>
</aaa>
我想:
<aaa class = "dog">
<bbb id = "three"/>
</aaa>
我用:
^(.)*dog(.|\r|\n|\t)*(three)
但它匹配:
<aaa class = "dog">
<bbb id = "one"/>
</aaa>
<aaa class = "dog">
<bbb id = "two"/>
</aaa>
<aaa class = "dog">
<bbb id = "three
我应该如何编辑正则表达式以匹配我想要的?