From mboxrd@z Thu Jan 1 00:00:00 1970 Date: Mon, 27 Oct 2008 23:08:10 +0200 From: Aharon Robbins To: 9fans@9fans.net Message-id: <200810272108.m9RL8AI4015465@skeeve.com> Content-transfer-encoding: 7BIT Subject: Re: [9fans] non greedy regular expressions Topicbox-Message-UUID: 296b238e-ead4-11e9-9d60-3106f5b1d025 > > As other mails have pointed out, anything that isn't leftmost longest > > has weird semantics. Non-greedy operators are mostly syntactic sugar. > > Is (leftmost-longest + all-greedy operators) syntactic salt then? It is merely the traditional POSIX flavor. Some people like that flavor, some don't. > > Not in the least. The Plan 9 regexp library in fact gives you close to > > the same nirvana; an automata that has DFA speed characteristics with > > the NFA's ability to capture sub texts. > > Does regexp(n) also give the lowlife any hint of why it should behave > differently from Perl? Friedl's book doesn't, but it has good reason. It is more that Perl simply was never part of the picture for the people who develop(ed) and use(d) Plan 9. It's like asking why the paper on the Plan 9 C compiler doesn't state that C++ classes are not available. The long-time users of Plan 9 were using Unix before Perl even came along; for reasons having to do with both taste and the theoretical soundness, they saw no reason to try to support the Perl features. After all, if you really want Perl, you know where to get it. Me, I'm pretty happy with the traditional shell + sed + grep + awk combinations, but then again, I'm biased, particularly towards awk. :-) Arnold