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,怎么样?
更改
(^/d+$)
Run Code Online (Sandbox Code Playgroud)
至
(\d+)$
Run Code Online (Sandbox Code Playgroud)
我确定^当匹配不在MULTILINE模式时会发生什么,但它几乎肯定不是你想要的.
| 归档时间: |
|
| 查看次数: |
110 次 |
| 最近记录: |