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,