Re: Regex pattern for URL matching

2008-10-06 Thread Merrick
I think this is related to WSGI. On Oct 6, 7:17 pm, Merrick <[EMAIL PROTECTED]> wrote: > That is the approach I took and how I resolved the original problem > with the 404. It led me to find that "AllowEncodedSlashes On" in > Apache is needed for encoded slashes to be allowed in the pathname >

Re: Regex pattern for URL matching

2008-10-06 Thread Merrick
That is the approach I took and how I resolved the original problem with the 404. It led me to find that "AllowEncodedSlashes On" in Apache is needed for encoded slashes to be allowed in the pathname information following the filename. The problem now is that http%3A%2F%2F prints http:/ in my

Re: Regex pattern for URL matching

2008-10-06 Thread Malcolm Tredinnick
On Mon, 2008-10-06 at 16:10 -0700, Merrick wrote: > keith, thanks for trying. > > %2f is the encoded value of /, but urls contain other characters as > well not just alphanumeric. I think you're debugging the wrong piece of the problem here. Your original regular expression must have been

Re: Regex pattern for URL matching

2008-10-06 Thread Merrick
While I have not found the complete solution, I am closer. I added this to my apache settings for the virtual host: AllowEncodedSlashes On I am no longer getting a 404. But even though the url has two instances of %2f to represent two slashes:

Re: Regex pattern for URL matching

2008-10-06 Thread Merrick
keith, thanks for trying. %2f is the encoded value of /, but urls contain other characters as well not just alphanumeric. I suspect this issue may have to do with apache or WSGI but not sure what. On Oct 6, 4:06 pm, "Keith Eberle" <[EMAIL PROTECTED]> wrote: > quick solution, i think you could

Re: Regex pattern for URL matching

2008-10-06 Thread Keith Eberle
quick solution, i think you could add the % to the regex (i'm hardly a regex master): r'^find/(?P[%-\w]+)$ keith On Mon, Oct 6, 2008 at 7:05 PM, Merrick <[EMAIL PROTECTED]> wrote: > > I have narrowed down the problem to %2F in my url, anyone? > > > > On Oct 6, 2:55 pm, Merrick <[EMAIL

Re: Regex pattern for URL matching

2008-10-06 Thread Merrick
I have narrowed down the problem to %2F in my url, anyone? On Oct 6, 2:55 pm, Merrick <[EMAIL PROTECTED]> wrote: > \w will only match alphanumeric characters, I need to match anything > and will let my modelform verify that it is indeed a URL. > > On Oct 6, 2:43 pm, Merrick <[EMAIL PROTECTED]>

Re: Regex pattern for URL matching

2008-10-06 Thread Merrick
Thank you, I meant urls.py. APPEND_SLASH = False so I omitted the trailing slash from the regex line: r'^find/(?P[-\w]+)$ and if I pull up the address: http://mydomain.com/find/http%3A%2F%2Fwww.wired.com%2F I still get Not Found The requested URL /find/http://www.wired.com/ was not found on

Re: Regex pattern for URL matching

2008-10-06 Thread Merrick
\w will only match alphanumeric characters, I need to match anything and will let my modelform verify that it is indeed a URL. On Oct 6, 2:43 pm, Merrick <[EMAIL PROTECTED]> wrote: > Thank you, I meant urls.py. APPEND_SLASH = False so I omitted the > trailing slash from the regex line: > >

Re: Regex pattern for URL matching

2008-10-06 Thread Keith Eberle
it looks like you have mismatched parens, and no trailing slash, which will matter if APPEND_SLASH = True. the regex should look like: r'^find/(?P[-\w]+)/$' should be urls.py too, not views.py. keith On Mon, Oct 6, 2008 at 1:17 PM, Merrick <[EMAIL PROTECTED]> wrote: > > I am trying to

Regex pattern for URL matching

2008-10-06 Thread Merrick
I am trying to figure out how to match / capture a URL. views.py === urlpatterns = patterns('', url(r'^find/(?P(.*)$', view = 'myapp.views.find', name = 'find' ), when I enter in this address: mydomain.com/find/www.wired.com my view / template are executed, but if