Problem with regular expression
Posted: Mon Oct 27, 2008 6:48 am
Hi there,
I've had a problem for the past couple days trying to create a match for some urls that I want to use..
For example in trying to match
I used the following:
It works fine and I am able to capture the "country" variable which in this case is britain, however when I make the url,
The regular expression captures "britain/london" as the "country" variable which is not what I want it to do. I expect that it would tell me that no match was found.
Is there something I am doing wrong...
I've had a problem for the past couple days trying to create a match for some urls that I want to use..
For example in trying to match
Code: Select all
localhost/place/britain
Code: Select all
{^place\/(?P<country>\w+|\w+[[:punct:]]+\w+)$}
Code: Select all
localhost/place/britain/london
Is there something I am doing wrong...