Skip to content

Commit

Permalink
document non-capturing groups (closes gorilla#143)
Browse files Browse the repository at this point in the history
  • Loading branch information
olt committed Sep 20, 2016
1 parent 0a192a1 commit 14f5df0
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions doc.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 47,10 @@ variable will be anything until the next slash. For example:
r.HandleFunc("/articles/{category}/", ArticlesCategoryHandler)
r.HandleFunc("/articles/{category}/{id:[0-9] }", ArticleHandler)
Groups can be used inside patterns, as long as they are non-capturing (?:re). For example:
r.HandleFunc("/articles/{category}/{sort:(?:asc|desc|new)}", ArticlesCategoryHandler)
The names are used to create a map of route variables which can be retrieved
calling mux.Vars():
Expand Down

0 comments on commit 14f5df0

Please sign in to comment.