I'm scratching my head trying to come up with a regex that extracts numbers from strings that are differently formatted. For example:
'1', '1.1', '1,1', '1,000,000.20', '1.00000020', '1.000.000,20', '10.20001'
I currently use the regex [-+]?[0-9]*[.,]?[0-9]+(?:[eE][-+]?[0-9]+)?
and it works well in the majority of the cases except from 1,000,000.20
and 1.000.000,20
.
Do you have any idea how can I tweak the previous regex to work with those examples?