I want to convert 3011 to 3.0.11, that is, the last two bits synthesize one bit
."3011".replace(/(\d{1})/g,"$1.").replace(/\.$/,"")
can be converted to 3.0.1.1
but why can"t you get 3.0.11
in this way?"3011".replace(/(\d{1})(\d{2})$/g,"$1.$2")
what you get is 30.11. Why can"t you get 3.0.11 in this way? how can you change it if you want to get it?