![]() |
|
Pathologically Eclectic Rubbish Lister | |
PerlMonks |
Re: Look behind and globalby maa (Pilgrim) |
on Mar 14, 2005 at 11:51 UTC ( #439234=note: print w/replies, xml ) | Need Help?? |
Hi gingaloon if you have 12345 then the sequences of two digits are 12 23 34 45... HTH - Mark Update: my (guessed) explanation as to why you don't get what you want is that you're not modifying the pattern "in-place", so to speak, so the regexp engine doesn't take account of the changes it makes. This is one use for backreferences (\1 \2 \3) Update 2: why not just s/(\d\d)/$1\n/g?
In Section
Seekers of Perl Wisdom
|
|