Lets say I have the following string:
<div style="color: red; display.: inline-block;"><i class="fa fa-arrow-down" aria-hidden="true"></i> -18.9%</div>
What want to extract is -18.9
I currently have [^0-9.-]+ in javascript But that will include every dot and hyphen in the string, so I need something that only extract comma and hyphen if followed by a number.
And to clearify, the dots and hyphens may or may not exist, sometimes not the html either