简体   繁体   中英

How to add a white space between two numbers -Regex.Replace()

Someone knows how to add a white space between two number when they do not have an space. So I have #,###,## and want #,## #,##

I have this:

2.100.000,000,04
300,450,06
23,011,87
54.845,37462.521,21

I want this:

2.100.000,00 0,04
300,45 0,06
23,01 1,87
54.845,37 462.521,21

In order to see if a replace should occur I did this expression \\,([0-9]{3})\\,

Thanks for your help.

Update 1

  • Number format could be #.###.###,## (always with two decimals)

$1 $2替换(,\\d{2})(\\d,)出现( $1$2是对捕获组的引用,具体取决于您可能需要使用\\1 \\2的语言或工具)。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM