scsh-users
[Top] [All Lists]

Re: Regexp notation

To: friedman@splode.com
Subject: Re: Regexp notation
From: Bill Sommerfeld <sommerfeld@apollo.hp.com>
Date: Fri, 10 Jan 1997 15:05:35 -0500
Cc: rpw3@rigden.engr.sgi.com, scsh@martigny.ai.mit.edu
> >because "(AND pat1 pat2)" -- or in agrep, "pat1;pat2" -- matches in any 
> >order.
> 
> I don't see how order can be important for either conjunction or
> disjunction of regexps, assuming that grouping can't be extended across
> patterns separated across `;' or `,'.

If you implement

        (match (and x y) ...)
        as
        (and (match x ...) (match y ...))

then order could matter from the point of view of performance.

Think about filtering a large file using

        (AND simple-fast-regexp slow-hairy-regexp)

where only a small fraction of the entries match the simple-fast-regexp..

                                        - Bill

<Prev in Thread] Current Thread [Next in Thread>