On 16/01/2011 01:48, Jean-Francois wrote:
Hi,

I try to match the following url with one regex

/hello
/hello/
/hello/world
/hello/world/


world is a variable, I can put toto instead

The regex is:

    ^/hello(?:/(?:[a-z]+/?)?)$

Its meaning is:

    start of string
    characters "/hello"
    optional:
        character "/"
        optional:
            one or more:
                one of:
                    "a" .. "z"
            optional:
                character "/"
    end of string

If it's not what you want, you need to be more specific.
--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to