Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Regexp Legibility

by patrickhaller (Initiate)
on Jun 14, 2009 at 05:21 UTC ( #771344=note: print w/ replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    $complex_re = /^($ip) ($host) ($msg)$/ if (
        $ip   = /\d+\.\d+\.\d+\.\d+/,
        $host = /[\-\.\w]+/,
        $msg  = /.*/
    );
    
  2. or download this
    my $complex_re = eval {
        my $ip   = qr/\d+\.\d+\.\d+\.\d+/;
    ...
    
        return /^($ip) ($host) ($msg)$/;
    );
    
  3. or download this
                     Rate    with eval without eval
    with eval    116279/s           --          -5%
    without eval 121951/s           5%           --
    

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (8)
As of 2014-10-31 10:50 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    For retirement, I am banking on:










    Results (216 votes), past polls