Perl Monk, Perl Meditation | |
PerlMonks |
Re: Re: Re: regex capturing problemby larryk (Friar) |
on Mar 21, 2002 at 16:23 UTC ( [id://153346]=note: print w/replies, xml ) | Need Help?? |
The point is not whether it can start matching in the middle of the string but whether it can start _capturing_ in the middle of the string. By adding a + to the first part you allow the RE engine to effectively ignore the ^ anchor while still forcing it to make a match at the end of the string.
larryk perl -le "s,,reverse killer,e,y,rifle,lycra,,print"
In Section
Seekers of Perl Wisdom
|
|