scsh-users
[Top] [All Lists]

Re: scsh regexp greediness

To: stktrc <stktrc@yahoo.com>
Subject: Re: scsh regexp greediness
From: RT Happe <rthappe@mathematik.uni-freiburg.de>
Date: Fri, 13 Dec 2002 18:36:00 +0100 (CET)
Cc: <scsh-news@zurich.ai.mit.edu>
On Fri, 13 Dec 2002, stktrc wrote:

> I've looked through the scsh manual, but could find anything on
> regular expression greediness.
>
> I'd need a regular expression to match as little (soon) as possible
> instead of as late (much) as possible.

(I am hardly familiar with regular expressions, neither in theory nor in
practice, but anyway,) I suppose that a matcher based on deterministic
finite automata is greedy by nature, and that Spencer's regexp engine
underneath scsh sports DFAs, speed and greed and nothing but.

> In Perl regexps it's done using a question mark after the quantifier
> ([a-z]* becomes [a-z]*?) IIRC.

Perl can support quite irregular expressions due to its non-DFA engine.

You may find some consolation in Olin Shivers' reasons for not supporting
back-references, at scsh.net > docu > design issues,
http://www.scsh.net/post/sreadt.html

rthappe



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