$ cat urfile
+005000
+000.50
+00000.005
+000003333.050
+000003333.00
$ sed -r 's/\+(0+)?([0-9]+)((\.[0-9]*[1-9])0*)?/+\2\4/g' urfile
+5000
+0.5
+0.005
+3333.05
+3333.00
sed -r 's/\+(0+)?([0-9]+)((\.[0-9])([0-9]*[1-9])?0*)?/+\2\4\5/g'
+5000
+0.5
+0.005
+3333.05
+3333.0
欢迎光临 Chinaunix (http://bbs.chinaunix.net/) | Powered by Discuz! X3.2 |