in reply to simple regex
Here is another way, based on the RE you used:
The trick is to loop looking for groups of 3 digits.
while($col=~s/(\d)(\d\d\d)(,|$)/$1,$2/) {} [download]