From f00ac810083e341fd41870a8e4a46e4b4dc14e62 Mon Sep 17 00:00:00 2001 From: astaxie Date: Wed, 10 Apr 2013 10:20:23 +0800 Subject: [PATCH] word change to string --- router.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/router.go b/router.go index 2bbfe5d6..f06b4b7d 100644 --- a/router.go +++ b/router.go @@ -48,13 +48,13 @@ func (p *ControllerRegistor) Add(pattern string, c ControllerInterface) { expr = part[index:] part = part[:index] //match /user/:id:int ([0-9]+) - //match /post/:username:word ([\w]+) + //match /post/:username:string ([\w]+) } else if lindex := strings.LastIndex(part, ":"); lindex != 0 { switch part[lindex:] { case ":int": expr = "([0-9]+)" part = part[:lindex] - case ":word": + case ":string": expr = `([\w]+)` part = part[:lindex] }