Limiting regex match
- by DMIL
Say I have this HTML fragment
<td width="25%" style="text-align:right;" >
<span style="font-family: Arial; font-size: 12px;">
<strong>Regular price:</strong></span>
</td>
<td width="25%" style="text-align:center;" >
<span style="font-family: Arial; font-size: 12px;>
<strong>11,100.00 USD</strong></span>
</td>
<td width="25%" style="text-align:right;" >
<span style="font-family: Arial; font-size: 12px;">
<strong>Web price:</strong></span>
</td>
<td width="25%" style="text-align:center;" >
<span style="font-family: Arial; font-size: 12px;>
<strong>9,100.00 USD</strong></span>
</td>
How would I get the first amount (11,100.00) using regex?
I tried
/Regular price.+(\d[^\s]+)\sUSD/is
but it's not working, it's returning '00'. Obviously I'm a newbie at regex and I'm hoping to get by without picking up a book.
And I HAVE to use regex to parse this HTML because that particular site was designed by someone who doesn't know about classes or IDs.