code: func (c *CORS) generatePatterns() {
  	if c.AllowOrigins != nil {
  		for _, origin := range c.AllowOrigins {
  			pattern := regexp.QuoteMeta(origin)
  			pattern = strings.Replace(pattern, "\\*", ".*", -1)
  			pattern = strings.Replace(pattern, "\\?", ".", -1)
  			c.allowOriginPatterns = append(c.allowOriginPatterns, "^"+pattern+"$")
  		}
  	}
  }
docs: // generatePatterns generates regex expression for AllowOrigins