On 2000.05.24, in <[EMAIL PROTECTED]>,
        "David Champion" <[EMAIL PROTECTED]> wrote:
> A look at the source code suggests that this is a misread, though, and
> that "^" goes before any pattern component.  Well, this pattern:
>       ^~L alice | ^~L bob | ^~L carol
> doesn't match anything at all.

I'm still curious about this, but read on.

On 2000.05.24, in <[EMAIL PROTECTED]>,
        "Mikko Hänninen" <[EMAIL PROTECTED]> wrote:
> David Champion <[EMAIL PROTECTED]> wrote on Wed, 24 May 2000:
> > I briefly tried using parens in a regexp way -- e.g.,
> >     ~L (alice|bob|carol)
> > but that doesn't seem to work at all.
> 
> I didn't look into this deeply, but just to throw an idea out --
> did you try something like:
> 
>   ^~L (alice|bob|carol)

That was one of the first things I tried, but as you noted below, that
makes Mutt treat the '|' as a pattern separator.

> > parens just to see what happens, I get "Unmatched ( or \(".
> 
> That sounds like a parson problem... Hmm, yes, if you escape the ()'s,
> then you need to escape the |'s too, or else they will be seen as as
> separating patterns, as opposed to separating expressions within a
> single pattern.

OK.  I didn't need to escape the parens at all, just the pipes.  This
expression is exactly what I'm looking for:
        ~L alice ~L bob ~L carol ^~L (alice\|bob\|carol)

(I was hoping that the parser would change the meaning of '|' inside
parens -- I didn't think of "\|" because I wasn't looking for a literal
pipe.)

Now, suppose I'm Alice.  I'd like to be able to remove the "alice"
parts of that and let $alternates cover it, but I don't see any way to
do that.  Is there some way to get $alternates into the expression?
Should there be?  I'm happy with a "yes" to either question. :)

Thanks, Mikko!

-- 
 -D.    [EMAIL PROTECTED]        NSIT    University of Chicago

Reply via email to