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]

Reply via email to