I have simple html code:
<span class="someclass" title="4.5 stars"></span>
or it could be:
<span class="someclass" title="5 stars"></span>
I used ((\d+\.\d+)|(\d+)) star but it extracted me 3 groups, I need one with numeric value.
How can I extract 4.5 and 5 in both strings using Regex in one group?
Thanks!
Try removing the inner parentheses:
Also, you may wish to consider using an HTML parser to extract the attributes first rather than applying the regular expression directly to the raw HTML.