cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tony Collen <colle...@umn.edu>
Subject Re: negate match
Date Thu, 08 Sep 2005 21:09:07 GMT
David wrote:
> I have been but it isn't working. Do you konw what the correct negation 
> operator is?
> 
> I know this works in PHP: ^((?!bob).)*$
> and I read that this should work in Java: ((?!bob).)*
> but it does not work in xmap's regexp matcher.
> 
> An example would be great.
> Eg.
> "!bob"

Hmm, it actually might not be all that easy.  The RegexpURIMatcher uses 
the org.apache.regexp package.

Details about the syntax are at:

http://jakarta.apache.org/regexp/apidocs/org/apache/regexp/RE.html

and it seems like you can do negation, but only with character classes 
(Unless I'm missing something painfully obvious)

I guess the brute force ugly way would be to subclass 
AbstractRegexpMatcher to return true if the RE *doesn't* match, or allow 
the matcher to take a parameter to tell it to use inverse logic for 
determining a match.

Tony

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Mime
View raw message