cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Nathaniel Alfred" <Alfred.Nathan...@swx.com>
Subject Wildcard matcher matching wild things
Date Wed, 20 Sep 2006 08:39:11 GMT
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?

Cheers, Alfred.

[1] http://marc.theaimsgroup.com/?l=xml-cocoon-dev&m=115096562921641&w=2
[2] http://marc.theaimsgroup.com/?l=xml-cocoon-dev&m=114915395328845&w=2
 
 
This message is for the named person's use only. It may contain confidential, proprietary
or legally privileged information. No confidentiality or privilege is waived or lost by any
mistransmission. If you receive this message in error, please notify the sender urgently and
then immediately delete the message and any copies of it from your system. Please also immediately
destroy any hardcopies of the message. You must not, directly or indirectly, use, disclose,
distribute, print, or copy any part of this message if you are not the intended recipient.
The sender's company reserves the right to monitor all e-mail communications through their
networks. Any views expressed in this message are those of the individual sender, except where
the message states otherwise and the sender is authorised to state them to be the views of
the sender's company.

Mime
View raw message