<<< Date Index >>>     <<< Thread Index >>>

Re: regex 101 misunderstanding



On 12:50 22 Nov 2004, Jim <jimo@xxxxxxxxxx> wrote:
| 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.
[...]
| So, I guess my question is really: How can we make a regex in Mutt
| that'll match things in those continued headers?
[...]

A bit of a look at the source (pattern.c, function msg_search) shows that
the search is pretty simple; searching headers and message body is the
same code. The search function goes to the right place (start of header
for a header search, start of body for a body search, start of header
for searching both) and computes a search length (length of headers for
just header, length of body for just body and length of both for both),
and then simply does a line-by-line search of the text spanned.

So there's not special multiline mode for a header search, and no trivial
way to make one.

At least now you know why it behaves as it does.

Cheers,
-- 
Cameron Simpson <cs@xxxxxxxxxx> DoD#743
http://www.cskk.ezoshosting.com/cs/

[...] if share-dealing had anything to do with future yields, we'd all
have BT shares and stockbrokers would be wise, Yoda-like figures who
don't touch cocaine for fear of the long-term risks. [...]
        - _NTK_, 26jul99 http://www.ntk.net/