This is my string: 50.00.00..00.00
50.00.00..00.00
I want to match all . except the last one, so after a replace I end up with 50000000.00
.
50000000.00
Can somebody help me with this?
.(?=.*.)
Matches a dot (.), which there must be another dot following it ((?=.*.)).
(?=.*.)
(This assumes the regex engine supports lookahead, e.g. PCRE, Python, etc.)
2.1m questions
2.1m answers
60 comments
57.0k users