nmh-workers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Nmh-workers] pick --'.*'.


From: Ralph Corderoy
Subject: Re: [Nmh-workers] pick --'.*'.
Date: Fri, 01 Dec 2017 22:57:01 +0000

Hi Valdis,

> And I was wondering what use case you had where you were searching for
> something where having the : was a problem.

Ah, well, say a subject starting `foo'.

Given the template is `^%s[ \t]*:.*%s' the simple `pick -sub ^foo'
fails because `^subject[ \t]*:.*^foo' has two `^'.

«pick -sub foo -and -not -sub '[^ ].*foo'» does better because the
second part rules out a non-space *after* the hard-coded colon before
the `foo'.  But the resulting regexp has two `.*' and I'd expect them to
compound under the NFA as it tries to succeed.  Plus, `subject: foo foo'
gets missed because the second foo fails the second term.  :-(

I was thinking that a `^' at the start of the regexp should mean the
`.*' after the colon in the template is dropped, and the `^' is dropped
too, giving `^subject[ \t]*:foo'.  It would then be up to me to allow
white-space after the colon.  Or the `.*' becomes `[ \t]*' so the `^'
anchors to the first non-white-space.

And a «-header '^foo:bar$'» might be useful too;  no implicit start of
line or white-space.

-- 
Cheers, Ralph.
https://plus.google.com/+RalphCorderoy



reply via email to

[Prev in Thread] Current Thread [Next in Thread]