Re: What's wrong with Tcl greediness?
- From: "Donal K. Fellows" <donal.k.fellows@xxxxxxxxx>
- Date: Thu, 6 Nov 2008 07:41:08 -0800 (PST)
Arjen Markus wrote:
The first quantifier you use is .*? - this is a non-greedy
quantifier. Its presence causes the _whole_ regular expression
to be non-greedy (a consequence of the regular expression
engine that is used, this makes it more efficient).
Also be aware that there are two ways of doing mixed greediness REs.
The Perl-derived systems do it one way, and the automata-theoretic
ones do it the other. Tcl uses an automata-theoretic RE engine, which
means that it can cope with evil cases comparatively easily. (The fine
details make my head ache...)
Donal.
.
- References:
- What's wrong with Tcl greediness?
- From: Koszalek Opalek
- Re: What's wrong with Tcl greediness?
- From: Arjen Markus
- What's wrong with Tcl greediness?
- Prev by Date: Re: invert black and white image
- Next by Date: Where to start when faced with Tk 8.5?
- Previous by thread: Re: What's wrong with Tcl greediness?
- Next by thread: working with oracle clob
- Index(es):
Relevant Pages
|