s/(\d{1,3}) (?= (?:\d\d\d)+ (?!\d) ) /$1,/gx; [download]
In reply to Re: regexp for adding commas to a number by tenatious in thread regexp for adding commas to a number by Kozz