I need to extract numeric values from strings like "£17,000 - £35,000 dependent on experience"
([0-9]+k?[.,]?[0-9]+)
That string is just an example, i can have 17k
17.000
17
17,000
, in every string there can be 0,1 or 2 numbers (not more than 2), they can be everywhere in the string, separated by anything else. I just need to extract them, put the first extracted in a place and the second in another.
I could come up with this, but it gives me two matches (don't mind the k?[,.]
, it's correct), in the $1
grouping. I need to have 17,000
in $1
and 35,000
in $2
, how can i accomplish this? I can also manage to use 2 different regex