路径中的 JaxRS 正则表达式

JaxRS regular expression in Path

我正在使用 JaxRS,我想为路径变量放置一个正则表达式。

@Path("/{environment : (?i)(zee|bar|foo)) }/{type : (123|1234)}")

现在很清楚我想要什么了。

ZEE 或 zee、BAR 或 bar、FOO 或 foo,以及任何其他 fOo、bAr 等不区分大小写的词。

type,取123或1234即可

我的正则表达式失败,它编译但我得到一个 404,对于 url 比如:

http://localhost:8080/api/test/fOo/123

(?i)(zee|bar|foo)) 中没有额外的右括号吗?