On Thu, 2008-02-28 at 15:02 +0100, Samuel Krieg wrote:
> Karsten Bräckelmann a écrit :
> > On Thu, 2008-02-28 at 14:26 +0100, Samuel Krieg wrote:
> >> I'm trying to create a rule to identify "\/ista" (with backslash + slash).
> >>
> >> This does not seem to work:
> >>
> >> body  WNG_OBFUVISTA      /\b\\\/ista\b/i
> >                            ^^^^
> > The backslash is not a word character. Thus, the \b word boundary
> > requires a word immediately preceding this (rather than a non-word). In
> > other words, this would fire only, if there is a char before this. It
> > will not, if it occurs after a space or at the beginning of the string.

> Thanks for your explanation. I've been used to add \b on every rule.
> 
> May I replace it with (\W|^) to get nearly the same effect?
> Like /(\W|^)\\\/ista\b/i

If you want to enforce a non-word char preceding this, the \W is fine.

However, the alternate anchor at the beginning of the string probably
will be rather useless. From the fine docs [1], body rule definitions:
  "All HTML tags and line breaks will be removed before matching."

I guess it pretty much depends on what you actually want to catch. You
do have a spample to run your rule against, right? Also, do you really
mean to match against the body (all textual parts), or do you mean to
trigger on the Subject only (which is part of a body rule, FWIW)?

  guenther


[1] http://spamassassin.apache.org/full/3.2.x/doc/Mail_SpamAssassin_Conf.html

-- 
char *t="[EMAIL PROTECTED]";
main(){ char h,m=h=*t++,*x=t+2*h,c,i,l=*x,s=0; for (i=0;i<l;i++){ i%8? c<<=1:
(c=*++x); c&128 && (s+=h); if (!(h>>=1)||!t[s+h]){ putchar(t[s]);h=m;s=0; }}}

Reply via email to