Search code examples
pythonregexgoogle-app-enginewebapp2

Creating a URL handler, but still getting 404. Is my regular expression wrong?


I am making a RequestHandler to handle tags on an app engine application. The URL is of the format

www.example.com/tags/tag=sometag

and my URL handler is as follows

app = webapp2.WSGIApplication(['/tags/"[a-zA-Z0-9=+]*$"', TagsHandler], debug=True)

I wrote that regular expression to accept any alphanumeric value including + and =. Am I right in thinking that this is the source of my problem ?

This is so that I can get the parameter tag from the url by using request.get and then displaying all posts tagged with that particular tag.

Edit

The question was answered:

app = webapp2.WSGIApplication['tags/[a-zA-Z0-9+=]*$', TagsHandler],  debug=True)

The quotes are not a part of the regular expression


Solution

  • Why are you using quotes here?

    '/tags/"[a-zA-Z0-9=+]*$"'
           ^               ^
    

    Can you just remove them?