spamassassin-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Amir Caspi <ceph...@3phase.com>
Subject Re: help with regex
Date Thu, 27 Feb 2014 01:09:14 GMT
On Feb 26, 2014, at 5:49 PM, Jeff Mincy <jeff@delphioutpost.com> wrote:

> Can't you do something like this using a look ahead regexp?
> 
> (?=[A-Z0-9]{30,})(?:[A-Z]*[0-9]){10,}

According to regexpal.com, that matches the OP's example.  The lookahead works properly in
this case, since trying to use (say) 28 numbers fails, while 10 numbers works.  As long as
SA can do lookahead, I think this should work.

I'm guessing the OP is trying to make a spam template match, much like the AC_SPAMMY_URI_PATTERNS
rules.  Typically, though, I've found that there's no real need to be THAT specific when matching
the template; almost no hammy emails will have alphanumeric strings of 30+ characters.  As
long as the rest of the URI match is sufficiently unique, there shouldn't be a need to be
overly specific about the string itself.  Of course, it all depends on the situation, which
would be much easier to assess if the OP posted an example. =)

Cheers.

--- Amir


Mime
View raw message