I have two types of possible lines to get information from:
<td class="forecast">106.2%</td>
or
<td class="forecast"></td>
And I want to get what is inside, it can be something, like a number, or it can be exactly nothing, not even a white space.
I have the following piece of regular expression:
<td class=\"forecast\">\\s*(.+?)\\s*</td>
It works, when there is content inside the HTML cell, but if there is nothing, it gets the following part of the HTML code.
Does someone knows how to solve this?
Just change the (.+?) to (.*?).
+ = One or More* = Zero or MoreAdded: Regexr
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With