while ( $text =~ s/(\d)((\d\d\d)+\b)/$1,$2/g ) { # Nothing to do inside the body of the while -- we merely want to reapply the regex until it fails } ----------------------------------------------------------------------------- Copyright 1997-2024 Jeffrey Friedl