dropping characters from regular expression groups
- by tcurdt
The goal: I want to convert a number from the format "10.234,56" to "10234.56"
Using this simple approach almost gets us there
/([\d\.]+),(\d\d)/ => '\1.\2'
The problem is that the first group of the match (of course) still contains the '.' character.
So questions are:
Is it possible to exclude a character from the group somehow?
How would you solve this with a single regexp
(I know this is a trivial problem when not using a single regexp)