code: func (m *RouteMux) AddRoute(method string, pattern string, handler http.HandlerFunc) {
  
  	//split the url into sections
  	parts := strings.Split(pattern, "/")
  
  	//find params that start with ":"
  	//replace with regular expressions
  	j := 0
  	params := make(map[int]string)
  	for i, part := range parts {
  		if strings.HasPrefix(part, ":") {
  			expr := "([^/]+)"
  			//a user may choose to override the defult expression
  			// similar to expressjs: ‘/user/:id([0-9]+)’ 
  			if index := strings.Index(part, "("); index != -1 {
  				expr = part[index:]
  				part = part[:index]
  			}
  			params[j] = part
  			parts[i] = expr
  			j++
  		}
  	}
  
  	//recreate the url pattern, with parameters replaced
  	//by regular expressions. then compile the regex
  	pattern = strings.Join(parts, "/")
  	regex, regexErr := regexp.Compile(pattern)
  	if regexErr != nil {
  		//TODO add error handling here to avoid panic
  		panic(regexErr)
  		return
  	}
  
  	//now create the Route
  	route := &route{}
  	route.method = method
  	route.regex = regex
  	route.handler = handler
  	route.params = params
  
  	//and finally append to the list of Routes
  	m.routes = append(m.routes, route)
  }
docs: // Adds a new Route to the Handler