Nathaniel Alfred wrote:
The head of 2.1 contains a new WildcardMatcherHelper [1] to replace the
rather obscure WildcardHelper [2] implementation. WMH is now used for
matching wildcard patterns in map:match.
Although the code is a lot clearer than WH, it is still very complex
logic. A number of bugs in the original WMH code have been fixed in the
meantime, but a few more seem to be lurking..
I recently fixed two bugs but now I am facing yet another one. This
time it is a false positive where "*" matches what should be matched
only by "**". Rather than submerging myself into the WMH code for
fixing it I am inclined to rewrite the stuff one more time.
Along the lines already discussed in the thread following [1] I would
use the regexp library to do the heavy lifting. Since map:match is the
most frequently executed pipeline instruction, speed is an issue. That
can be mastered by a) caching the compiled regexps and b) handling the
simple pattern with a single * or ** as special cases without using
regexps.
At the same time regexps would also remove the known limitation that
"**/*/*" cannot match because "**" is over-greedy in the current WMH
implementation.
WDYT?
As you and Bertrand said, speed and compatibility are very important. If your
new implementation takes care of both and is proved by tests, I don't see a problem.
--
Reinhard Pötz Independent Consultant, Trainer & (IT)-Coach
{Software Engineering, Open Source, Web Applications, Apache Cocoon}
web(log): http://www.poetz.cc
--------------------------------------------------------------------
___________________________________________________________
Telefonate ohne weitere Kosten vom PC zum PC: http://messenger.yahoo.de