go-martini/martini — pull request #269 by omeid (2014-05-26 06:47:55+00:00)
Title: Fix using Regexp ASCII classes in route path.

When using the ASCII classes in regex for routers, it failes with this error:

```package main

import (
"net/http"

"github.com/codegangsta/martini"
)

func main() {
m := martini.Classic()

m.Get("/(?P[:alnum:]+)", func(r *http.Request, params martini.Params) (int, string) {
return 200, params["id"]
})

m.Run()
}
```

```
$ go run main.go
panic: regexp: Compile(`/(?P[(?P[^/#?]+))\/?`): error parsing regexp: unexpected ): `/(?P[(?P[^/#?]+))\/?`

goroutine 1 [running]:
runtime.panic(0x5d21c0, 0xc21000a770)
/usr/lib64/golang/src/pkg/runtime/panic.c:266 +0xb6
regexp.MustCompile(0xc21001eb40, 0x22, 0x1f)
/usr/lib64/golang/src/pkg/regexp/regexp.go:207 +0x141
github.com/codegangsta/martini.newRoute(0x67b580, 0x3, 0xc21004a680, 0x1f, 0xc21000a5e0, ...)
/home/ome/microcloud/src/github.com/codegangsta/martini/router.go:192 +0x209
github.com/codegangsta/martini.(*router).addRoute(0xc21001f410, 0x67b580, 0x3, 0x69c610, 0x13, ...)
/home/ome/microcloud/src/github.com/codegangsta/martini/router.go:141 +0x45a
github.com/codegangsta/martini.(*router).Get(0xc21001f410, 0x69c610, 0x13, 0xc21000a5e0, 0x1, ...)
/home/ome/microcloud/src/github.com/codegangsta/martini/router.go:75 +0x75
main.main()
//go/src/learning/main.go:14 +0xd7
exit status 2

```

This pull request will fix it.

TODO: include test case for these classes?