This is my string: 50.00.00..00.00
I want to match all . except the last one, so after a replace I end up with 50000000.00
So you did not specified your regex tools, engine, etc. Well you can do this with e.g. sed (only work if there are always two digits after the last dot and the last dot is always present):
echo "50.00.00..00.00" | sed 's/\.//;s/\(..\)$/.\1/'
But there are several other ways, e.g. with lookahead regex (if it's supported for you).
HTH