I want to extract decimal number 265.12 or 0.0 from alphanumeric string (say amount) having value $265.12+ or $265.12- or
265.12
0.0
$265.12+
$265.12-
Without error checks, following will do:
var string = "$123123.0980soigfusofui" var number = parseFloat(string.match(/[\d\.]+/))
123123.098