cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Boissé Denis <>
Subject RE: regexpUriMatcher
Date Thu, 02 Aug 2007 19:07:19 GMT

Thank for you're help:

You said:

^temp/(.*?)/  matches temp/hello/

Yes it's true

^temp/(.*?)/  will also matches temp/hello/dir/ , temp/hello/dir/dir1/, etc

It's the same behaviour for ^temp/(.*?)/$  (I notice that in my program)

Yes it make sense that Cocoon uses Java's builtin regexp classes

-----Message d'origine-----
De : Tobia Conforto [] 
Envoyé : 2 août 2007 08:50
À :
Objet : Re: regexpUriMatcher

Boissé Denis wrote:
> Usually ungreedy matcher are in a form (.*?) and suppose to match
> something like temp/hello/ or temp/hi/ but not matching something like
> temp/hello/dir/ (that's what happen to me)

As Alfred said, you cannot use the 'greediness' of quantifiers to
control the matching of an anchored regexp, because they will always
grow as much as needed to match the string, if possible.

You tipically use them to give more weight to one piece of the regexp
with respect to another piece.  Compare:



They will match "temp/a/b/c/" as ("a", "b/c") and ("a/b", "c") resp.
What you described is true when the regexp is not anchored:

^temp/(.*?)/  matches temp/hello/
^temp/(.*)/   matches temp/hello/dir/

Anyways, I believe Cocoon uses Java's builtin regexp classes:


To unsubscribe, e-mail:
For additional commands, e-mail:

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message