Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
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 lurking in the Monastery: (10)
As of 2015-07-30 09:40 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (270 votes), past polls