http://www.perlmonks.org?node_id=883257


in reply to Integer to Money format

my $n = '4123456789'; $n =~ s/(?<= \d )(?= (?:\d{2})* \d{3} $ )/,/gx;