Google应用引擎实体键的正则表达式 [英] Regular expression for Google app engine entity keys

查看:109
本文介绍了Google应用引擎实体键的正则表达式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我找到了这篇文章,现在我想用这个正则表达式


然而,在我的处理程序中,我写了类似于

 ('/ xxx / [a-zA-Z0-9-_]',MyHandler)

但它不起作用...当我尝试访问链接时,它说找不到...我尝试了很多变体,但编辑:感谢帮助家伙......这样一个愚蠢的错误:)$ / $> $ / $> $ / $> b $ b

解决方案

您的正则表达式与 / xxx / 一个字符匹配c>部分。您需要通过添加 + 乘数来指定您希望1 或更多

 ('/ xxx / [a-zA-Z0-9 -_] +',MyHandler)

现在,您的表达式与任何至少具有 1个字符的任何内容匹配,而不仅仅是1个字符。


I found this post, and now i want to use that regular expression too What characters are allowed in a Google App Engine Key?

However, in my handler i write something like

('/xxx/[a-zA-Z0-9-_]', MyHandler)

but it doesn't work...when i try to access a link it says not found...i tried many variations but can't seem to make it happen...Help?!

EDIT : Thanks for the help guys...such a foolish mistake :)

解决方案

Your regular expression matches just one character after the /xxx/ part. You need to specify that you want 1 or more by adding the + multiplier:

('/xxx/[a-zA-Z0-9-_]+', MyHandler)

Now your expression matches anything that has at least 1 character, not just 1 and nothing more.

这篇关于Google应用引擎实体键的正则表达式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆