gnu-arch-users
[Top][All Lists]
Advanced

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

Re: [Gnu-arch-users] Preventing matches in regular expressions


From: Tom Lord
Subject: Re: [Gnu-arch-users] Preventing matches in regular expressions
Date: Wed, 11 Aug 2004 00:22:52 -0700 (PDT)

    > From: Jan Hudec <address@hidden>

    > On Mon, Aug 09, 2004 at 15:29:53 -0400, Aaron Bentley wrote:
    [regexp foo]

    > A general solution would be to use a negative lookahead
    > assertion. But I don't know whether they are implemented in
    > hackerlab. Hackerlab has something called a "cut" operator. I
    > can't find it's documentation so I am not sure whether it can be
    > used, but I think it can.

You're right that `cut' can be used.

"Negative lookahead operators" (or more generally, just boolean logic
over regexps) can, in theory, be implemented -- but `not' and `and'
are fairly expensive.

`cut' plays a trick to optimize just a few special cases of what you
could do with "negative lookahead operators", one of which is the case
abentley wants to have (essentially the same case optimized by
`lex(1)').

-t






reply via email to

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