Skip to content

Commit

Permalink
Merge pull request #196 from olt/doc-non-capture-groups
Browse files Browse the repository at this point in the history
document non-capturing groups (closes #143)
  • Loading branch information
kisielk authored Sep 20, 2016
2 parents 0a192a1 + 14f5df0 commit 757bef9
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 757bef9

Please sign in to comment.