应用引擎网址不匹配

Con*_*Hui 0 python regex google-app-engine

我试图匹配由数字组成的每个URL.

我的YAML文件:

- url: /createaccount/(^\d+$)
script: Python/CreateAccount.py
Run Code Online (Sandbox Code Playgroud)

和Python文件:

application = webapp.WSGIApplication([('/createaccount', CreateAccount),
                                  ('/createaccount/(^/d+$)', Confirmation)
                                  ], debug = True)
Run Code Online (Sandbox Code Playgroud)

但它不匹配网址/createaccount/123,怎么样?

Dav*_*ith 5

更改

(^/d+$)
Run Code Online (Sandbox Code Playgroud)

(\d+)$
Run Code Online (Sandbox Code Playgroud)

我确定^当匹配不在MULTILINE模式时会发生什么,但它几乎肯定不是你想要的.