in reply to The "anchor" misnomer in regexes
This doesn't satisfy the meaning of "minimal match" in English, so of course it's confusing.
If the "left-most-longest" principle must be used here, then the intent of the minimal match has been overpowered by a greedy rule. For minimal matches, the "left-most-longest" should be replaced by "left-most-shortest". If it's not, then "mimimal matching" isn't minimal at all!
The problem with regular expressions is that they attempt to be a set of rules for what gets matched, without a documented set of rules for how that matching gets done. When implicit rules about how matching gets done (ie. minimal matching isn't) raise their ugly head, of course people get confused; they've been told the details don't matter, when ultimately they really do.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: "Minimal" matching isn't....
by Eimi Metamorphoumai (Deacon) on Dec 19, 2005 at 21:13 UTC | |
|
Re: “Minimal” matching isn’t…
by Aristotle (Chancellor) on Dec 26, 2005 at 06:04 UTC |