in reply to Regex split string into n-length
Thank you so much guys. I didn't notice I got such many helps here. ;)
Just share, I got another working regex from perlguru, I changed \d to \w.
$line =~ s/(\w{3}(?!$))/$1-/xg;
By the way, is there a major processing speed to concern since there are more than one regex to get the same results?
such as:$string =~ s/(\w\w\w)(?!$)/$1-/g; from McA s/(\w{3})\B/$1-/g from Ken
|
|---|