[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Fancy split - simple regexp problem
From: |
Nicolas Berthier |
Subject: |
Re: Fancy split - simple regexp problem |
Date: |
Wed, 26 Oct 2011 10:41:45 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/23.3 (gnu/linux) |
The following message is a courtesy copy of an article
that has been posted to gnu.emacs.gnus as well.
Adam Sjøgren wrote:
> [...]
>
> When I try with this split:
>
> ("X-Bugzilla-Product" "\\w+" "bugzilla.\\&")
>
> B q tells me:
>
> "This message would go to bugzilla.m"
>
> [...]
>
> I'm sure there is an obvious thing, I just can't see it.
As you can see on the other branch of this thread, others are trolling
on this topic. So no, it's not that obvious. IMO, the problem is
indeed greedyness of `re-search-backward' that is not POSIX compliant
apparently [1].
You may be interrested in trying the following hack (or something
similar) which makes fancy splitting use a greedy yet much slower
backward searching algorithm:
(defadvice nnmail-split-it (around my-greedy-nnmail-split-it activate)
"Around advice temporarily replacing `re-search-backward' with
`posix-search-backward'."
(flet ((re-search-backward (regexp &optional bound noerr count)
(posix-search-backward regexp bound noerr count)))
ad-do-it))
Nicolas
[1] http://www.gnu.org/s/emacs/manual/html_node/elisp/POSIX-Regexps.html
--
Nicolas Berthier FSF Student member #7975
- Re: Fancy split - simple regexp problem,
Nicolas Berthier <=