On Tue, 11 Feb 2003, darren chamberlain wrote:
> > *@aol.*
> > *@*.parliment.uk
> > fred@*.sourceforge.*
> > etc.
>
> Hmm, nice:
>
> # Assume @addrs is the above list:
> for (my $i = 0; $i < @addrs; $i++) {
> $addrs[$i] =~ s/\*/.*/g;
> $addrs[$i] =~ s/\./\\./g;
> $addrs[$i] = qr($addrs[$i]);
> }
>
> You've got a list of regexes. Cool.
Except for one thing: you'll want to swap those first two statements
in the for loop -- otherwise you'll end up escaping your regex '.'s that
replaced the wildcard '*'s...
--
Steve Reppucci [EMAIL PROTECTED] |
Logical Choice Software http://logsoft.com/ |
=-=-=-=-=-=-=-=-=-=- My God! What have I done? -=-=-=-=-=-=-=-=-=-=
_______________________________________________
Boston-pm mailing list
[EMAIL PROTECTED]
http://mail.pm.org/mailman/listinfo/boston-pm