in reply to Re: Grabbing file prefixes with Reg Exp
in thread Grabbing file prefixes with Reg Exp
Also, I agree with dws regarding the readability of the character classes, and believe you're altogether mistaken regarding the performance issue:my @files = grep s/\.ram$//i , readdir DH;
use strict; use Benchmark qw(cmpthese); my $strorig = 'yabadabadooo this bud is a buda fora youa'; cmpthese (-3, { mod => sub { my $str = $strorig; $str =~ m/.*BUD.*/i }, class => sub { my $str = $strorig; $str =~ m/.*[Bb][Uu][Dd].*/ }, }); ## Results (under ActiveState 5.6) ## Rate class mod class 347719/s -- -15% mod 408606/s 18% --
MeowChow s aamecha.s a..a\u$&owag.print
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Re: Grabbing file prefixes with Reg Exp
by japhy (Canon) on May 14, 2001 at 02:47 UTC |