Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re^2: Named capture backreferences cannot be used in character classes?

by Anonymous Monk
on Sep 26, 2013 at 22:49 UTC ( #1055918=note: print w/ replies, xml ) Need Help??


in reply to Re: Named capture backreferences cannot be used in character classes?
in thread Named capture backreferences cannot be used in character classes?

Probably not worth it, but fewer negative look-aheads:

my $re = qr/ (?<FQ>['"]) # Capture starting quote. (?<content> # Capture content. (?: (?>[^'"]*) # Match non-quotes, don't backtrack. (?(?!\k<FQ>).) # Match opposite quote. )* # Repeat. ) \k<FQ> # Match ending quote. /x;


Comment on Re^2: Named capture backreferences cannot be used in character classes?
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (7)
As of 2014-12-20 20:54 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (98 votes), past polls