Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

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

by demerphq (Chancellor)
on Oct 03, 2005 at 22:32 UTC ( #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
Node Status?
node history
Node Type: note [id://497068]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (6)
As of 2020-05-26 11:47 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    If programming languages were movie genres, Perl would be:















    Results (150 votes). Check out past polls.

    Notices?