Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
ie:
$string='abchijk'; while ($string =~ s/(\w{2})(.*)$/$1\|$2/) { print "$string\n"; } should print: ab|chijk ab|ch|ijk ab|ch|ij|k
s/pre/code/ tags - dvergin 2002-04-29
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: regex multiple times
by Zaxo (Archbishop) on Apr 30, 2002 at 02:09 UTC | |
|
Re: regex multiple times
by Cyrnus (Monk) on Apr 30, 2002 at 02:30 UTC | |
|
Re: regex multiple times
by abaxaba (Hermit) on Apr 30, 2002 at 03:07 UTC |