Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
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 rifling through the Monastery: (11)
As of 2015-08-28 20:11 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The oldest computer book still on my shelves (or on my digital media) is ...













    Results (340 votes), past polls