I've got the following String "$120 foo $100 bar"
and I want to get just the last number so I end up with just "100".
I've had an attempt at it but can only get the first number (120) instead of the second number. This is what I have so far.
price.value.match(/\d+/);
Worth noting, on some occasions I may just have one number in the String "£80 GBP"
. I would like the regex to always give me the last number displayed.
Can anyone suggest the regex I should be using?