>>>>> "SAC" == Scott A Crosby <Scott> writes:

SAC> Yes. Thanks.. For my current work, observe this regexp used by SA:

SAC> 2   '[EMAIL PROTECTED](?:[\-.0-9A-Z_a-z]+\.)+\w+'

SAC> Feed it a bunch of dot's followed by a non-word...

SAC> Say... '[EMAIL PROTECTED]'

SAC> and, on some regexp interpreters, that line will take a few minutes to
SAC> fail to match. I've not tested perl; you can if you wish.

Well, perl eats thru that one faster than you can blink.  On a dual
1.25GHz G4 powermac running perl 5.8.0 with this script:

#!/opt/local/bin/perl -wT
use strict;

use Time::HiRes qw(gettimeofday);

my $str = '[EMAIL PROTECTED]';

my $st = gettimeofday;
$str =~ m/[EMAIL PROTECTED](?:[\-.0-9A-Z_a-z]+\.)+\w+/;
my $et = gettimeofday;

print "started $st\nended $et\nelapsed ".($et-$st)."\n";


it prints this:

started 1058557662.08352
ended 1058557662.08387
elapsed 0.000345945358276367

The regexp engine in perl is quite smart, and if you give it hints, it
gets even better...

-- 
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Vivek Khera, Ph.D.                Khera Communications, Inc.
Internet: [EMAIL PROTECTED]       Rockville, MD       +1-240-453-8497
AIM: vivekkhera Y!: vivek_khera   http://www.khera.org/~vivek/


-------------------------------------------------------
This SF.net email is sponsored by: VM Ware
With VMware you can run multiple operating systems on a single machine.
WITHOUT REBOOTING! Mix Linux / Windows / Novell virtual machines at the
same time. Free trial click here: http://www.vmware.com/wl/offer/345/0
_______________________________________________
Spamassassin-talk mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/spamassassin-talk

Reply via email to