\< and \> don't quite make it

N.J. Mann njm at njm.f2s.com
Tue Sep 12 22:35:05 CEST 2006


On Thu 07 Sep 20:16, Mike Peeler wrote:
> N.J. Mann <njm at njm.f2s.com> wrote:
> > 
> > I am trying to use scoring
> You don't need to count, you only need to know if the filename occurs.

True for my example, but in the real recipe there are actually over 180
different pathnames.  I had never used scoring before and thought this
was a chance to give it a try.  It also seemed the easiest way of doing
a very long logical OR.

> >     :0 f
> >     * 1^1 ^Subject:.*\<ports/x11/xterm\>
> >     | formail -I "X-Status: F"
> > 
> > As well as matching on    ports/x11/xterm
> > it also matches on        ports/x11/xterm-whatever
> > which I do not want.
> So far, this would do:
>       *     ^Subject:.*\<ports/x11/xterm\/\>
>       * ! MATCH ?? ^^-
> > The Subject line may contain one pathname/filename combination or
> > many.  Thus the ability to detect the end of a word by encountering
> > either whitespace or newline is what I am looking for.
> OK, that tells me why you were trying to count.  Here's one that won't
> get spoofed in the first place.  If "whitespace" simply means a space:
>       *     ^Subject:.*\<ports/x11/xterm( |$)

This seems to work quite well: I haven't had any false positives so far
and have had lots of true positives since I switched to your suggestion.

Many thanks.

Captain Muller: "You boy! Your name will also go on the list. What is it?"
Captain Mainwaring: "Don't tell him Pike!"

More information about the procmail mailing list