Ruby ¤À¤È
re = /(\d{1,3}\.\d+\z|\d{1,3}(?=\d{3}*\z|\d{3}+\.\d+\z))/ '1234567890'.gsub(re, '\\1 ') #=> "1 234 567 890 " '1234567890.1234'.gsub(re, '\\1 ') #=> "1 234 567 890.1234 " '0.1234'.gsub(re, '\\1 ') #=> "0.1234 "
ºÇ¶á¤Î¥³¥á¥ó¥È