[tin-users] Help for filtering regex

Joe joe.on.list at gmail.com
Sun Oct 22 14:52:52 CEST 2017


Thank you,
I had solved by trying a rule like the following:
------------
comment=example
group=ex.ample
case=0
score=kill
from=.*(?!samuelson).*son\.yada at example.net\s\(John\s\b(?!Samuelson).*son\b\).*
-------------

My original regex was based on a pattern like:
John  somethingson <somethingson at example.net>

Then, after a better reading of the tin man and filtering.txt docs, I
realize it converts the From field  to an old-style format before
trying the regex. So I should have considered a different pattern
based on something like the following:

somethingson at example.net (John somethingson)

And finally I reached my goal with the above reported REGEX.

Your confirm about the tin compatibility with PCRE regex is very
useful along your explanation about scoring!

Anyway, just for curiosity, where this information (I mean tin
filtering regex are in pcre style) is "formally" written? I couldn't
find it on the man pages nor at the site docs...

Thank you a lot for your reply!
Bye!




On Fri, Oct 20, 2017 at 6:06 PM, Urs Jan├čen <urs at tin.org> wrote:
> On Fri, Oct 20, 2017 at 02:21:17PM +0200, Joe wrote:
>> Now, the first question is: what REGEX types does tin supports?
>
> perl compatible (pcre is used as engine) if wildcard=1 in tinrc.
>
>> grep -P 'John\s\b(?!Samuelson).*son\b' input-names.txt
>
> lookahead paterns are supported, so that
>
> group=*
> case=0
> score=kill
> from=John\s\b(?!Samuelson).*son\b
>
> should work or you could use scooring
>
> give enery article that matches
> John\s+.*son\b a score of eg -100
> and the ones which match
> John\sSamuelson a score of 100
> at the end John\sSamuelson gets a score of 0 as he matches both filters
> so his articles are "untouched", but the other John *son are killed.
>
> group=*
> case=0
> score=kill
> from=John\s+.*son\b
>
> group=*
> case=0
> score=hot
> from=John\sSamuelson\b
>
> _______________________________________________
> tin-users mailing list
> tin-users at tin.org
> http://lists.tin.org/cgi-bin/mailman/listinfo/tin-users



More information about the tin-users mailing list