Help for this page

Select Code to Download


  1. or download this
    /^[056]0+/
    
  2. or download this
    /^(?:0|5|6)0+/
    
  3. or download this
    use Benchmark 'cmpthese';
    my @list = ( '00012345', 'D123470', '0000123450', '0000023456', '50000
    +123990' );
    ...
       charclass => sub { grep /^[056]0+/, @list },
       alt => sub { grep /^(?:0|5|6)0+/, @list },
    };
    
  4. or download this
    Benchmark: running alt, charclass, each for at least 3 CPU seconds...
           alt:  3 wallclock secs ( 3.00 usr +  0.00 sys =  3.00 CPU) @ 50
    +5561.00/s (n=1516683)
    ...
                  Rate       alt charclass
    alt       505561/s        --       -5%
    charclass 534973/s        6%        --