$space[$i] =~ s/((?:[A-Z][^A-Z\n]*){10})/$1\n/gx; [download]
In reply to Re: Inserting characters into strings by borisz in thread Inserting characters into strings by Anonymous Monk