in reply to simple regex
#!/usr/bin/perl $_ = '1234567'; $_ = reverse $_; s/(\d{3})(?=\d)/$1,/g; $_ = reverse $_; print $_ ; [download]