Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
*/
public class UrlPatternMatcher {
// Finds parameters in the URL pattern string.
private static final String URL_PARAM_REGEX = "\\{(\\w*?)\\}";
private static final String URL_PARAM_REGEX = "\\{(\\S*?)\\}";

// Replaces parameter names in the URL pattern string to match parameters in URLs.
private static final String URL_PARAM_MATCH_REGEX = "\\([%\\\\w-.\\\\~!\\$&'\\\\(\\\\)\\\\*\\\\+,;=:\\\\[\\\\]@]+?\\)";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ private static Stream<Arguments> providePathsThatMatch() {
Arguments.of("/{id}/pets/{id2}", "/1/pets/2?q=1&q2=2"),
Arguments.of("/{id}/{foo}/{id2}", "/1/2/3?q=1&q2=2"),
Arguments.of("/{id}/{foo}/{id2}", "/1/2/3"),
Arguments.of("/v2/pets/{id}", "/v2/pets/1"));
Arguments.of("/v2/pets/{id}", "/v2/pets/1"),
Arguments.of("/pets/{pet-id}/types/{type-id}", "/pets/1/types/2"));
}

}