I try to preg_match the end of two html tags
<span class="a">
<span>123</span>
<span>456</span></span>
<span class="b">
<span>789</span>
....
I want to get the content of class a (123 456) and try this pattern
preg_match('#<span\sclass="a">(.*?)</span></span>#')
but I just get the first span (123).
How can I end the pattern in </span></span>