about summary refs log tree commit diff
path: root/route.go
diff options
context:
space:
mode:
Diffstat (limited to 'route.go')
-rw-r--r--route.go8
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 {