Re: regex 101 misunderstanding
On Mon, Nov 22, 2004 at 12:04:10PM -0500, Patrick Shanahan wrote:
> Please try:
> ~h Received.*jimo\\+blah
Thanks, Patrick (and Gary),
The double backslash does, indeed work, but only if the pattern is
found in the first portion of the header, not, as is nearly always
the case on Received: headers, in the indented continuation portions.
I did a bit more testing, and it seems the ``+'' character isn't the
problem, the continued header is. You can test the concept with
any header; it doesn't have to be Received: to demonstrate the effect.
I'd have thought Mutt's ~h pattern specifier would have silently
joined all the continuation lines into their respective headers (sort
of analagous to formail's -c flag), but apparently not.
So, I guess my question is really: How can we make a regex in Mutt
that'll match things in those continued headers?
I don't see any explicit examples of regex matching across lines
in the Mutt manual, though I might have missed it. When I try
~h "received.*$.*jimo\\+blah"
or
~h "received.*\$.*jimo\\+blah"
or
~h 'received.*\$.*jimo\\+blah' etc...
it fails as before.
Any ideas on continued-header searching?
Thanks again for the responses,
Jim