如何在网址格式中指示一个或多个匹配项? [英] How to indicate one or more match in url pattern?
本文介绍了如何在网址格式中指示一个或多个匹配项?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
"/*"
将匹配零个或更多字符.如果有一个个字符或更多字符,我想投放请求
继续使用"/"字符.
"/*"
will match zero or more characters. I want to serve request if there is a one or more characters
proceeding the "/" character.
注意:我正在使用Guice的Servlet模块来配置请求.
Note: I am using Guice's Servlet Module to configure the request.
谢谢!
推荐答案
我认为您可以做到这一点,前提是您要匹配任何/
及其后有1个或多个字符的内容(因此/a
,但不是/
).
I think you can just do this, assuming you mean that you want to matching anything with a /
and 1 or more characters after it (so /foo
and /a
but not /
).
serveRegex("/.+")
这篇关于如何在网址格式中指示一个或多个匹配项?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文