Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re: Dynamic regex assertions, capturing groups, and parsers: joy and terror

by demerphq (Chancellor)
on Oct 03, 2005 at 22:32 UTC ( [id://497068]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    $rx = qr{ (.) (??{ print $1 }) }x;
    print "!" if "japhy" =~ $rx;
    __END__
    japhy
    
  2. or download this
    $rx = qr{ (.) (??{ print $1; '' }) }x;
    print "!" if "japhy" =~ $rx;
    __END__
    j!
    

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others perusing the Monastery: (7)
As of 2024-03-28 22:06 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found