Jim B <[EMAIL PROTECTED]> wrote:
>
> I believe this can be corrected by a well-written regular expression, but
> I'm not so good at that so I'm wondering if anyone can help.
This won't work with Mutt as it's currently coded, because Mutt assumes
that the reply_regexp matches something at the *beginning* of the
string, and takes anything following that match as the "real subject."
Mutt uses code like this:
if (e->subject)
{
regmatch_t pmatch[1];
rfc2047_decode (e->subject, e->subject, mutt_strlen (e->subject) + 1);
if (regexec (ReplyRegexp.rx, e->subject, 1, pmatch, 0) == 0)
e->real_subj = e->subject + pmatch[0].rm_eo;
else
e->real_subj = e->subject;
}
The pmatch[] array contains a list of matches to subexpressions within
the regular expression. pmatch[0], used here, matches the entire
regular expression. As written, the "real subject" is taken to be
whatever comes after the reply_regexp. So...
> Subject: RE: [GeneralService] Word1 Word2 [IMS2000012500000368242002]
>
> set reply_regexp = "^(re|aw):[ \t]*[ \t]\[[a-z0-9]*\]"
>
> but that apparently doesn't work.
Nope, that won't work, because the reply_regexp matches the entire
string, leaving no "leftover" text for the "real subject".
By the way, something to watch out for in .mutrrc's:
set reply_regexp = "^(re|aw):[ \t]*"
This doesn't do what you think it does; Mutt sees the "\t" as simply
"t", because backslashes are parsed within double-quotes. So the regexp
comes out as "^(re|aw):[ t]*", and so a subject like "Re: Tuesday" comes
out with a real subject of "uesday". :)
Maybe there's a way to get middle-matching of subjects; I'll have to
play with it.
--
David DeSimone | "The doctrine of human equality reposes on this:
[EMAIL PROTECTED] | that there is no man really clever who has not
Hewlett-Packard | found that he is stupid." -- Gilbert K. Chesterson
UX WTEC Engineer | PGP: 5B 47 34 9F 3B 9A B0 0D AB A6 15 F1 BB BE 8C 44