I've seen a few questions like this with the accepted answers being to use a HTML parser. BUT if I HAD to use regex (php), how could I get the span
text in the below examples based on the class name.
<span class="phone-number" data-id="999" style="{lots of random stuff here}">+61 9900 0000</span>
<span class="email" data-something="xxx" style="{lots of random stuff here}">test@test.com</span>
So my variables would be element type and class name.
With my basic knowledge, I've gotten this far:
(?<=span class="phone-number")\s+(.*?)(?=<\/span>)
but that includes the data and style attributes.