I am having trouble distinguishing two templates when I aplly match.find().
String template1 = "GET /boards/(.+?)";
String template2 = "GET /boards/(.+?)/lists";
When given the following input : "GET /boards/boardName/lists" , it matches with the first template instead of the second. What am I doing wrong ?
Thanks in advance
+?will still match (non-greedily) the character after the last forward slash because.matches any single character except newline. Therefore, it matches on this expression first. If you don't want the first expression to match, change it toGET /boards/([^/]+)$boardName/lists. In the second case group 1 containsboardName. Both patterns will match.