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 [mailto:[EMAIL PROTECTED] Envoyé : 2 août 2007 08:50 À : [email protected] 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: ^temp/(.*?)/(.*)/$ ^temp/(.*)/(.*?)/$ 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: http://java.sun.com/j2se/1.5.0/docs/api/java/util/regex/Pattern.html Tobia --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
