diff options
Diffstat (limited to 'route.go')
-rw-r--r-- | route.go | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/route.go b/route.go index a33a78f..925bfb5 100644 --- a/route.go +++ b/route.go @@ -28,10 +28,10 @@ type Match struct { Method string } -var componentIsVariable = regexp.MustCompile("^:") -var componentsIsOptional = regexp.MustCompile("^\\?:") -var namedComponentsRegex = regexp.MustCompile("^:(.*)$") -var convertComponent = regexp.MustCompile("^\\??:(.*)$") +var componentIsVariable = regexp.MustCompile("^{[^}]+}$") +var componentsIsOptional = regexp.MustCompile("^\\?{.*}$") +var namedComponentsRegex = regexp.MustCompile("^{(.*)}$") +var convertComponent = regexp.MustCompile("^\\??{(.*)}$") // XXX explain this function func (self *Route) convertComponentName(name string) string { |