Can't map regular expression - java.lang.IllegalArgumentException: The number of capturing groups in the pattern segment

后端 未结 1 1323
挽巷
挽巷 2020-12-11 15:43

I have the following method defined in my controller:

@RequestMapping(value = \"/ajax/comments/post/{contentId:([apv]|ad)\\\\d+}\")
    public @ResponseBody
         


        
相关标签:
1条回答
  • 2020-12-11 16:08

    Everything is said in the error message: use non-capturing groups instead

    (?:[apv]|ad)\\d+
    

    See http://www.regular-expressions.info/brackets.html for further details.

    0 讨论(0)
提交回复
热议问题