[ Brian L. Heess - home writes: ]
>
> Not being the pro at regexp's, I thought somebody might be able to help me
> with one:
>
> I would like this blocked:
>
> /^from:.*gahan@*/i
>
> But this allowed:
>
> /^from:.*vi_gahan@*/i
As Jason indicated, Mj2 already has what you want (I'll let him explain
it if you need more detail), but I think the ordering of your regexes
may make a big difference since one is a substring of the other.
As for your regexes, note that these are are a subset of real Perl
regexes, so the '@' has to be escaped, i.e. '\@'. Also, what you wrote
is "zero or more '@' (at the end of the match)". I don't think that's
what you meant. Even if you meant to write '.*' (zero or more of any
character), that's just wasted cycles at the end of a regex in this
context. If you don't care what follows, then why check?
--
Dave Wolfe
References:
|
|