how to match a url in urls.py

2011-10-03 Thread He Jibo
Hello, I want to match a url in urls.py. Can you teach me how to do it? Thanks.I have tried the following two versions. But as long as I put a . (dot) in the regular expression, it gives me a "bad character range" error. (r'^pagerank/(?P*([/w-]+/.)+[/w-]+.([^a-z])(/[/w-: ./?%&=]*)?|[a-zA-Z/-/.

Re: how to match a url in urls.py

2011-10-03 Thread Brian Mehrman
Hi He, I always try to break my regex's down to their simplest components, then test them here, http://www.regular-expressions.info/javascriptexample.html. Try testing each part of your regex there and see if you can see which part is broken. Also an example url of what you are trying to match wou

Re: how to match a url in urls.py

2011-10-03 Thread Javier Guerra Giraldez
On Mon, Oct 3, 2011 at 9:56 AM, He Jibo wrote: >    (r'^pagerank/(?P([/w-]+/.)+[/w-]+.([^a-z])(/[/w-: > ./?%&=]*)?|[a-zA-Z/-/.][/w-]+.([^a-z])(/[/w-: ./?%&=]*)?)', > 'ueseo.pagerank.views.CheckPageRankStatic'),# a static page version of page > rank check is that a copy/paste? i think you're usin

Re: how to match a url in urls.py

2011-10-03 Thread Bjarni Rúnar Einarsson
The complaint about invalid ranges probably stems from the fact that you have '-' in the middle of your character lists. If you do not mean [a-z], you should always make the dash the last character, like so: [az-]. The expression as pasted is requesting ranges [w-:] in a couple of places, which i