scsh-users
[Top] [All Lists]

Re: Regexp notation

To: scsh@martigny.ai.mit.edu
Subject: Re: Regexp notation
From: Jussi Piitulainen <jpiitula@ling.helsinki.fi>
Date: 13 Jan 1997 11:30:42 +0200
Organization: University of Helsinki, Finland
friedman@splode.COM (Noah Friedman) writes:

> >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 `,'.

I thought the remark meant that it is convenient to match, e.g., `a*c'
and `b*d' against all of

        _a_c_b_d_,
        _a_b_c_d_,
        _a_b_d_c_,
        _b_a_c_d_,
        _b_a_d_c_,
        _b_d_a_c_,

that is, the matching parts in the text can be in any order, even
interleaved.  It would be unpleasant to be forced to write a single
regexp of concatenation, union and closure to do that; concatenation
is so particular about the order.
-- 
Jussi Piitulainen 

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