Beefy Boxes and Bandwidth Generously Provided by pair Networks DiBona
Perl Monk, Perl Meditation
 
PerlMonks  

Re: regular expression

by ww (Bishop)
on Aug 03, 2012 at 14:51 UTC ( #985254=note: print w/ replies, xml ) Need Help??


in reply to regular expression

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.


Comment on Re: regular expression
Select or Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://985254]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (7)
As of 2014-04-19 06:13 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    April first is:







    Results (478 votes), past polls