Gnus development mailing list
 help / color / mirror / Atom feed
* Fancy-Split / Regexp question
@ 2012-02-06  7:01 michael.zombok
  2012-02-06 14:08 ` Tassilo Horn
  0 siblings, 1 reply; 10+ messages in thread
From: michael.zombok @ 2012-02-06  7:01 UTC (permalink / raw)
  To: ding

Hello gnu'sers,

I am trying hard to setup a fancy-splitting-rule for a mailing list. The
'tag' in the subject header of the mails I want to catch is '[ab-cd-ef]'
(including the braces) but I don't get it. I tried various versions
without success. What is the correct syntax?

(any ".*\\[ab-cd-ef\\].*" "news.ab-cd-ef")
(any ".*\[ab-cd-ef\].*" "news.ab-cd-ef")
(any ".*[ab-cd-ef].*" "news.ab-cd-ef")

???

Of course, it should NOT match a mail with the following tag in the
subject header '[ab]'.

Thank you in advance!

Best,
Michael









^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Fancy-Split / Regexp question
  2012-02-06  7:01 Fancy-Split / Regexp question michael.zombok
@ 2012-02-06 14:08 ` Tassilo Horn
  2012-02-06 15:29   ` Andreas Schwab
  2012-02-07 15:39   ` Ted Zlatanov
  0 siblings, 2 replies; 10+ messages in thread
From: Tassilo Horn @ 2012-02-06 14:08 UTC (permalink / raw)
  To: michael.zombok; +Cc: ding

michael.zombok@googlemail.com writes:

Hi Michael,

> I am trying hard to setup a fancy-splitting-rule for a mailing list.
> The 'tag' in the subject header of the mails I want to catch is
> '[ab-cd-ef]' (including the braces) but I don't get it. I tried
> various versions without success. What is the correct syntax?
>
> (any ".*\\[ab-cd-ef\\].*" "news.ab-cd-ef")

Syntactically, this regex is correct, i.e., it matches only the string
containing "[ab-cd-ef]".  You can omit the two ".*", though.

I think, the problem is the `any'.  If I remember correctly, that's a
shorthand for To, From, Cc, Bcc, but not Subject.  So probably you want
a rule like that:

  ("subject" "\\[ab-cd-ef\\]" "news.ab-cd-ef")

Bye,
Tassilo

BTW: If that's a mailing list, it's probably better to use the List-Id
header for splitting.



^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Fancy-Split / Regexp question
  2012-02-06 14:08 ` Tassilo Horn
@ 2012-02-06 15:29   ` Andreas Schwab
  2012-02-07  6:20     ` Basil Abou El-Komboz
  2012-02-07 15:39   ` Ted Zlatanov
  1 sibling, 1 reply; 10+ messages in thread
From: Andreas Schwab @ 2012-02-06 15:29 UTC (permalink / raw)
  To: Tassilo Horn; +Cc: michael.zombok, ding

Tassilo Horn <tassilo@member.fsf.org> writes:

> michael.zombok@googlemail.com writes:
>
> Hi Michael,
>
>> I am trying hard to setup a fancy-splitting-rule for a mailing list.
>> The 'tag' in the subject header of the mails I want to catch is
>> '[ab-cd-ef]' (including the braces) but I don't get it. I tried
>> various versions without success. What is the correct syntax?
>>
>> (any ".*\\[ab-cd-ef\\].*" "news.ab-cd-ef")
>
> Syntactically, this regex is correct, i.e., it matches only the string
> containing "[ab-cd-ef]".  You can omit the two ".*", though.

No, you cannot omit ".*", because fancy splitting matches on word
boundaries, and [ ] aren't word characters.

Andreas.

-- 
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."



^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Fancy-Split / Regexp question
  2012-02-06 15:29   ` Andreas Schwab
@ 2012-02-07  6:20     ` Basil Abou El-Komboz
  0 siblings, 0 replies; 10+ messages in thread
From: Basil Abou El-Komboz @ 2012-02-07  6:20 UTC (permalink / raw)
  To: Andreas Schwab; +Cc: Tassilo Horn, ding

Hi,

("subject" ".*\\[ab-cd-ef\\].* "news.ab-cd-ef")

works fine. Thank you both for your suggestions!

Best,
Michael


Tassilo Horn <tassilo@member.fsf.org> writes:

> michael.zombok@googlemail.com writes:
>
> Hi Michael,
>
>> I am trying hard to setup a fancy-splitting-rule for a mailing list.
>> The 'tag' in the subject header of the mails I want to catch is
>> '[ab-cd-ef]' (including the braces) but I don't get it. I tried
>> various versions without success. What is the correct syntax?
>>
>> (any ".*\\[ab-cd-ef\\].*" "news.ab-cd-ef")
>
> Syntactically, this regex is correct, i.e., it matches only the string
> containing "[ab-cd-ef]".  You can omit the two ".*", though.

No, you cannot omit ".*", because fancy splitting matches on word
boundaries, and [ ] aren't word characters.

Andreas.

-- 
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."





^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Fancy-Split / Regexp question
  2012-02-06 14:08 ` Tassilo Horn
  2012-02-06 15:29   ` Andreas Schwab
@ 2012-02-07 15:39   ` Ted Zlatanov
  2012-02-07 20:34     ` Lars Ingebrigtsen
  1 sibling, 1 reply; 10+ messages in thread
From: Ted Zlatanov @ 2012-02-07 15:39 UTC (permalink / raw)
  To: ding

On Mon, 06 Feb 2012 15:08:56 +0100 Tassilo Horn <tassilo@member.fsf.org> wrote: 

TH> I think, the problem is the `any'.  If I remember correctly, that's a
TH> shorthand for To, From, Cc, Bcc, but not Subject.  So probably you want
TH> a rule like that:

TH>   ("subject" "\\[ab-cd-ef\\]" "news.ab-cd-ef")

From the manual:

`from'
     Matches the `From', `Sender' and `Resent-From' fields.

`to'
     Matches the `To', `Cc', `Apparently-To', `Resent-To' and
     `Resent-Cc' fields.

`any'
     Is the union of the `from' and `to' entries.

I think it would be nice to have "any+" which matches the Subject as
well.  WDYT?

Ted




^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Fancy-Split / Regexp question
  2012-02-07 15:39   ` Ted Zlatanov
@ 2012-02-07 20:34     ` Lars Ingebrigtsen
  2012-02-07 22:34       ` Ted Zlatanov
  0 siblings, 1 reply; 10+ messages in thread
From: Lars Ingebrigtsen @ 2012-02-07 20:34 UTC (permalink / raw)
  To: ding

Ted Zlatanov <tzz@lifelogs.com> writes:

> I think it would be nice to have "any+" which matches the Subject as
> well.  WDYT?

I think that mostly just seems confusing.  `any' means basically "all
the address fields", and mixing the Subject header into that seems
pretty arbitrary.

-- 
(domestic pets only, the antidote for overdose, milk.)
  http://lars.ingebrigtsen.no  *  Sent from my Rome



^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Fancy-Split / Regexp question
  2012-02-07 20:34     ` Lars Ingebrigtsen
@ 2012-02-07 22:34       ` Ted Zlatanov
  2012-02-08  8:23         ` Tassilo Horn
  0 siblings, 1 reply; 10+ messages in thread
From: Ted Zlatanov @ 2012-02-07 22:34 UTC (permalink / raw)
  To: ding

On Tue, 07 Feb 2012 21:34:05 +0100 Lars Ingebrigtsen <larsi@gnus.org> wrote: 

LI> Ted Zlatanov <tzz@lifelogs.com> writes:
>> I think it would be nice to have "any+" which matches the Subject as
>> well.  WDYT?

LI> I think that mostly just seems confusing.  `any' means basically "all
LI> the address fields", and mixing the Subject header into that seems
LI> pretty arbitrary.

Then `any' is badly named, if it's really `any-address'.  The idea with
`any+' is to catch e-mails about "XYZ" in the subject even though the
majority of the cases have "XYZ" in the address fields.  For me it's
useful and I have 3 such duplicate rules in my fancy rules.  But I can
live with duplicate rules, if I'm the only one.

Ted




^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Fancy-Split / Regexp question
  2012-02-07 22:34       ` Ted Zlatanov
@ 2012-02-08  8:23         ` Tassilo Horn
  2012-02-11 16:26           ` Daniel Dehennin
  0 siblings, 1 reply; 10+ messages in thread
From: Tassilo Horn @ 2012-02-08  8:23 UTC (permalink / raw)
  To: ding

Ted Zlatanov <tzz@lifelogs.com> writes:

> LI> I think that mostly just seems confusing.  `any' means basically
> LI> "all the address fields", and mixing the Subject header into that
> LI> seems pretty arbitrary.
>
> Then `any' is badly named, if it's really `any-address'.  The idea
> with `any+' is to catch e-mails about "XYZ" in the subject even though
> the majority of the cases have "XYZ" in the address fields.  For me
> it's useful and I have 3 such duplicate rules in my fancy rules.  But
> I can live with duplicate rules, if I'm the only one.

Since `any' has been To and From for ages, I'd keep it that way.  But of
course, adding a `any-header' that matches `any' + subject + list-id
could be convenient.

Bye,
Tassilo



^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Fancy-Split / Regexp question
  2012-02-08  8:23         ` Tassilo Horn
@ 2012-02-11 16:26           ` Daniel Dehennin
  2012-02-13 17:18             ` Ted Zlatanov
  0 siblings, 1 reply; 10+ messages in thread
From: Daniel Dehennin @ 2012-02-11 16:26 UTC (permalink / raw)
  To: ding

[-- Attachment #1: Type: text/plain, Size: 725 bytes --]

Tassilo Horn <tassilo@member.fsf.org> writes:


[...]

>
> Since `any' has been To and From for ages, I'd keep it that way.  But of
> course, adding a `any-header' that matches `any' + subject + list-id
> could be convenient.

Hello,

I used to redefine 'nnmail-split-abbrev-alist to add mailing-list
headers to 'any.

One problem with 'any use is for group split, it could use something
else than 'any when 'to-list is defined.

This would require more than one rule per group, something like:

- 'any for 'to-address, 'extra-aliases and maybe adding 'admin-address(?)
- 'list for 'to-list

Regards.
-- 
Daniel Dehennin
Récupérer ma clef GPG:
gpg --keyserver pgp.mit.edu --recv-keys 0x6A2540D1

[-- Attachment #2: Type: application/pgp-signature, Size: 197 bytes --]

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Fancy-Split / Regexp question
  2012-02-11 16:26           ` Daniel Dehennin
@ 2012-02-13 17:18             ` Ted Zlatanov
  0 siblings, 0 replies; 10+ messages in thread
From: Ted Zlatanov @ 2012-02-13 17:18 UTC (permalink / raw)
  To: ding

On Sat, 11 Feb 2012 17:26:58 +0100 Daniel Dehennin <daniel.dehennin@baby-gnu.org> wrote: 

DD> Tassilo Horn <tassilo@member.fsf.org> writes:
>> Since `any' has been To and From for ages, I'd keep it that way.  But of
>> course, adding a `any-header' that matches `any' + subject + list-id
>> could be convenient.

DD> One problem with 'any use is for group split, it could use something
DD> else than 'any when 'to-list is defined.

DD> This would require more than one rule per group, something like:

DD> - 'any for 'to-address, 'extra-aliases and maybe adding 'admin-address(?)
DD> - 'list for 'to-list

I'm in favor or 'any-header as Tassilo says (with Daniel's additions)
and 'list as Daniel suggested.

Ted




^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2012-02-13 17:18 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-02-06  7:01 Fancy-Split / Regexp question michael.zombok
2012-02-06 14:08 ` Tassilo Horn
2012-02-06 15:29   ` Andreas Schwab
2012-02-07  6:20     ` Basil Abou El-Komboz
2012-02-07 15:39   ` Ted Zlatanov
2012-02-07 20:34     ` Lars Ingebrigtsen
2012-02-07 22:34       ` Ted Zlatanov
2012-02-08  8:23         ` Tassilo Horn
2012-02-11 16:26           ` Daniel Dehennin
2012-02-13 17:18             ` Ted Zlatanov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).