有這麼一段html,要匹配href標籤
<a href="http://www1.test.io/">test</a><img src="./src/img.png"/><a href="http://www2.test.io/">test2</a><div class="test1">
錯誤方法:
href=".*"
匹配結果:
<a href="http://www1.test.io/">test</a><img src="./src/img.png"/><a href="http://www2.test.io/">test2</a><div class="test1">
正確的匹配方法:
href=".+?"