Trt Trt
Trt Trt

Reputation: 5532

JaxRS regular expression in Path

I am using JaxRS and I want to put a regex for a path variable.

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

Now it is pretty clear what I want.

ZEE or zee, BAR or bar, FOO or foo, along with any other fOo, bAr, etc etc case insensitive word.

Same with type, just take 123 or 1234

My regex is failing, it compiles but I am getting a 404, for a url like:

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

Upvotes: 0

Views: 252

Answers (1)

Xavier Coulon
Xavier Coulon

Reputation: 1600

don't you have an extra closing parenthesis in (?i)(zee|bar|foo)) ?

Upvotes: 1

Related Questions