title: How do you match character OR end of string in a golang regexp?
body: <p>I am having trouble working out (in golang), within a regular expression, how to match a character, separator, or end of string.  The following does almost what I want:</p>
  
  <pre><code>url := "test20160101"
  if i, _ := regexp.MatchString("[-a-zA-Z/]20[012]\\d[01]\\d[0123]\\d[-a-zA-Z/]", url); i == true {
      t := regexp.MustCompile("[-a-zA-Z/](20[012]\\d[01]\\d[0123]\\d)[-a-zA-Z/]").FindStringSubmatch(url)[1]
      fmt.Println("match: ", t)
  }
  </code></pre>
  
  <p><a href="https://play.golang.org/p/eWZ_DiOVBl" rel="nofollow">https://play.golang.org/p/eWZ_DiOVBl</a></p>
  
  <p>But I want to also match the following:</p>
  
  <pre><code>url := "test-20160101-"
  url := "/20160101/page.html"
  </code></pre>
  
  <p>I notice there is a \z in <a href="https://golang.org/pkg/regexp/syntax/" rel="nofollow">the golang documentation</a> however that doesn't work, at least when I put it inside <code>[-a-zA-Z/]</code> i.e. <code>[-a-zA-Z\\z/]</code></p>