Try downloading Kodos and sticking in your regex and the string you want to match it and see what it says.
Todd On Jan 2, 2008 12:59 AM, Greg <[EMAIL PROTECTED]> wrote: > > ocgstyles, > Tried it...still no good > > (r'^(?P<manufacturer>[a-zA-Z]+)_(?P<line>[a-zA-Z]+)/$', 'showline'), > > > On Jan 1, 11:23 pm, ocgstyles <[EMAIL PROTECTED]> wrote: > > I'm confused now too... :-/ > > > > Try taking out the hyphen and see what happens... > > > > On Jan 1, 11:45 pm, Greg <[EMAIL PROTECTED]> wrote: > > > > > Todd, > > > My app works fine. When I have the following line in my url file then > > > everything works fine > > > > > (r'^(?P<manufacturer>[\w-]+)/(?P<line>[\w-]+)/$', 'showline'), > > > > > ///////// > > > > > It just doesn't work with I take out the '/' and replace it with the > > > '_' > > > > > On Jan 1, 10:25 pm, "Todd O'Bryan" <[EMAIL PROTECTED]> wrote: > > > > > > Have you added the app to your INSTALLED_APPS ? > > > > > > Maybe you should paste in your site's urls.py as well as the app's. > > > > > > On Jan 1, 2008 11:09 PM, Greg <[EMAIL PROTECTED]> wrote: > > > > > > > ocgstyles, > > > > > I've tried the following combinations however I still get the Page Not > > > > > Found error: > > > > > > > (r'^(?P<manufacturer>[a-zA-Z-]+)_(?P<line>[a-zA-Z-]+)/$', 'showline'), > > > > > (r'^(?P<manufacturer>[-a-zA-Z]+)_(?P<line>[-a-zA-Z]+)/$', 'showline'), > > > > > (r'^(?P<manufacturer>[a-zA-Z\-]+)_(?P<line>[a-zA-Z\-]+)/$', > > > > > 'showline'), > > > > > (r'^(?P<manufacturer>[a-zA-Z_]+)_(?P<line>[a-zA-Z_]+)/$', 'showline'), > > > > > > > On Jan 1, 9:52 pm, ocgstyles <[EMAIL PROTECTED]> wrote: > > > > > > I thought you wanted to capture either words or hyphens, so I just > > > > > > replaced \w, which also consumes underscores, with [a-zA-Z], which > > > > > > doesn't consume the underscores. So the new regex > > > > > > > > [a-zA-Z-]+ > > > > > > > > will consume one or more letters or hyphens. The one I replaced it > > > > > > with should work for sprint-phone_cellphone. > > > > > > > > On Jan 1, 10:36 pm, Greg <[EMAIL PROTECTED]> wrote: > > > > > > > > > ocgstyles, > > > > > > > I'm not sure what's going on. What does the last '-' mean in the > > > > > > > following code [a-zA-Z-]? Occasionally I'm going to have the a > > > > > > > url > > > > > > > that is going to have a '-' in the variable. For > > > > > > > examplehttp://mysite.com/sprint-phone_cellphone. So I'm not sure > > > > > > > if [a-zA- > > > > > > > Z-] is going to work. > > > > > > > > > On Jan 1, 8:51 pm, ocgstyles <[EMAIL PROTECTED]> wrote: > > > > > > > > > > worked for me using the following: > > > > > > > > > > [urls.py] (i removed the single quotes around the view) > > > > > > > > from myapp.views import showline > > > > > > > > (r'^(?P<manufacturer>[a-zA-Z-]+)_(?P<line>[\w-]+)/$', showline), > > > > > > > > > > [views.py] > > > > > > > > def showline(request, manufacturer, line): > > > > > > > > return HttpResponse('manu = ' + manufacturer + '<br />line = > > > > > > > > ' + > > > > > > > > line) > > > > > > > > > > Maybe the error is being generated from somewhere else? > > > > > > > > > > On Jan 1, 9:42 pm, Greg <[EMAIL PROTECTED]> wrote: > > > > > > > > > > > ocgstyles, > > > > > > > > > I tried the following however I'm still getting a page not > > > > > > > > > found > > > > > > > > > error: > > > > > > > > > > > (r'^(?P<manufacturer>[a-zA-Z-]+)_(?P<line>[\w-]+)/$', > > > > > > > > > 'showline'), > > > > > > > > > > > On Jan 1, 8:23 pm, ocgstyles <[EMAIL PROTECTED]> wrote: > > > > > > > > > > > > Hi Greg, > > > > > > > > > > > > The problem is that "\w" is consuming the underscore. > > > > > > > > > > Instead of > > > > > > > > > > using [\w-], use [a-zA-Z-]. The pattern would then look > > > > > > > > > > like: > > > > > > > > > > > > (r'^(?P<manufacturer>[a-zA-Z-]+)_(?P<line>[\w-]+)/$', > > > > > > > > > > 'showline') > > > > > > > > > > > > Hope that helps. > > > > > > > > > > > > Keith > > > > > > > > > > > > On Jan 1, 9:05 pm, Greg <[EMAIL PROTECTED]> wrote: > > > > > > > > > > > > > Hello, > > > > > > > > > > > I orginially had my url like this: > > > > > > > > > > > > > (r'^(?P<manufacturer>[\w-]+)/(?P<line>[\w-]+)/$', > > > > > > > > > > > 'showline') > > > > > > > > > > > > > Which would work fine when going to the url > > > > > > > > > > > 'www.mysite.com/sprint/ > > > > > > > > > > > cellphone/' > > > > > > > > > > > > > ////////////// > > > > > > > > > > > > > However, I want to change my url structure so that all of > > > > > > > > > > > my pages are > > > > > > > > > > > as close to the root as possible. So I replaced my '/' > > > > > > > > > > > in the url > > > > > > > > > > > with a '_'. Like so: > > > > > > > > > > > > > (r'^(?P<manufacturer>[\w-]+)_(?P<line>[\w-]+)/$', > > > > > > > > > > > 'showline') > > > > > > > > > > > > > However, I now get a page not found whenever I view the > > > > > > > > > > > following url > > > > > > > > > > > 'www.mysite.com/sprint_cellphone/' > > > > > > > > > > > > > //////// > > > > > > > > > > > > > Can I not replace the / with a _ in my url? > > > > > > > > > > > > > Thanks > > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~----------~----~----~----~------~----~------~--~---

