[oclug] Quick Regexp question

Paul Faure paul at engsoc.carleton.ca
Sun Nov 2 23:29:52 EST 2003


How do I convert 1234567 to 1,234,567 in perl?
So far I got
  $vol=~s/(\d{3})/,$1/g;
But that creates ,123,4567
That would be fine if it started searching from right to left instead of
left to right.

Cheers.

-- 
Paul N. Faure, B.Eng                      613.266.3286
Computer Systems Engineering              paul-at-faure-dot-ca
Chief Technical Officer, CertainKey Inc.  paul-at-certainkey-dot-com



More information about the OCLUG mailing list