On Fri, May 31, 2002 at 08:39:20AM -0500, David T-G wrote:
> % just occured to me that this won't match "back2" either, since it starts
> % with a "b"...
> 
> Yeah, that's another problem that occurred to me after posting.  I had
> the same sort of problem with $alternates; I'd really like to be able to
> say something like
> 
>   set alternates = "[^(laura*|madi|^quin*)]@justpickone.*"

what we need is like the perl lookbehind:

       (?<!pattern)
                 A zero-width negative lookbehind assertion.  For
                 example /(?<!bar)foo/ matches any occurrence of
                 "foo" that isn't following "bar".  Works only
                 for fixed-width lookbehind.

so you could do

  set alternates ="(?<!laura|madi|quin)@justpickone"

but note that I had to remove the "*" (which I think were supposed to be
".*") - since it only works for a fixed-width string...

another by the way - having a trailing .* is a nop, just eats cpu cycles
(in a patterm match)...

:)

-- 
Dan Boger
Linux MVP
brainbench.com

Attachment: msg28430/pgp00000.pgp
Description: PGP signature

Reply via email to