GNU bug report logs - #12375
Broken matching of regexps in fancy splitting

Previous Next

Packages: gnus, emacs;

Reported by: jathd <jathdr <at> gmail.com>

Date: Fri, 7 Sep 2012 05:31:02 UTC

Severity: normal

Tags: fixed

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

Full log


Message #11 received at 12375 <at> debbugs.gnu.org (full text, mbox):

From: jathd <jathdr <at> gmail.com>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: 12375 <at> debbugs.gnu.org
Subject: Re: bug#12375: Broken matching of regexps in fancy splitting
Date: Sat, 02 Feb 2013 20:02:30 +0100
Lars Ingebrigtsen <larsi <at> gnus.org> writes:

> Do you have `nnmail-split-fancy-match-partial-words' set?  If not, the
> splitting machinery will put a \\< in front of the regexp, leading to
> "batteries" being matched.

I have `nnmail-split-fancy-match-partial-words' set to `nil', and I
checked that the splitting process does put a "\\<" in the regexp.

The problem is that this regexp is used to decide whether a message
follows a rule (in other words, that regexp is matched against the
message header), but when extracting the value with which to replace
"\\1" in the group name "list.devel.\\1" I gave, it matches a second
time with the *original regexp* I gave (and not the whole header this
time, it narrows the search to the interesting part of the relevant
header field). So this time, it uses the regexp without the "\\<", which
explains why it replaces "\\1" with "s" instead of "batteries".

So there's a simple workaround: I just put a "\\<" in the regexp in
`nnmail-split-fancy', and it works fine. So I don't know if this is a
bug or not; the workaround is simple, but I still find the behaviour of
the matcher a bit unexpected. Namely, I would expect it to match as if
using `(string-match regexp-I-gave contents-of-relevant-header-field)'.
Maybe the manual should have a word about this?

-- 
jathd




This bug report was last modified 8 years and 176 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.