Pathologically Eclectic Rubbish Lister | |
PerlMonks |
Re: regular expressionby ww (Archbishop) |
on Aug 03, 2012 at 14:51 UTC ( [id://985254]=note: print w/replies, xml ) | Need Help?? |
The initial deathstar ( .*) is greedy, qv.
IOW, there's nothing left for your capture after leading .* matched everything in your string. Read, instead, about look-aheads or try capturing the first Sanity_001_ and the balance of the string (to a second capture clause), and printing/saving only $2 -- either can help you, but learning about look-aheads (and the general category, of which it's a part, "look arounds") will help you greatly, even in the short term.
In Section
Seekers of Perl Wisdom
|
|