I have a string value that will look like this:
"ZAR 200.15"
Using regex, how can I extract the float value to do calculations with?
For some context, I'm using javascript to access an HTML element's value like this:
var amountDueString = document.getElementById("amountDue").innerHTML;
Then I need to use regex to only get the float value.
var amountDue = amountDueString.match(---some regex---);
I want to extract the float value in order to compare it with user input.
/\b\d+(?:\.\d+)?/