I'm working on a Google appengine project and I've encountered a quandary. The following should (if the regex's are normal) redirect everything which does not contain the word "test" to the MainPage class, and the rest to the TestPage class.
application = webapp.WSGIApplication(
[
('[^(test)]*', MainPage),
('.+', TestPage)
],
debug=True)
Instead, I find that the regular expression is being interpreted:
('[^tes]*', MainPage)
This means that anything which includes a t, e, or s will NOT direct to MainPage (in this case, it will direct to TestPage). Obviously, the workaround is to re-write the TestPage regex, but I don't want to have to make a work around. This should work without being re-written.
Am I missing some library somewhere? Is this a configuration issue? I have far less issue with calling a function or setting a property before running run_wsgi_app
, but this looks inconsistent as is.
UPDATE
It turns out that the culprit was two things. First it was a mistake on my part in the syntax (Mea culpa). Second, the tool I had used to confirm the regular expression said that the expression would not match "test " but it would match "t est ".