title: golang regular expression ReplaceAllString
body: <p>I am writing a chatbot program in the Go programming language.
  In this function it reads in a user string checks for a regular expression and then is supposed to remove the expression and replace with another string if found. It is successful in finding a match but will not append it to the string</p>
  
  <pre><code>input = "I am feeling happy"
  pattern2 := []string{`.*i am.*`, `.*I AM.*`, `.*I'm.*`, `.*i'm.*`, `.*im.*`, `.*I am.*`}
  
  // loop through pattern2 array
  //if pattern is found extract substring
  //set response
  
  for _, checkPattern := range pattern2 {
      re := regexp.MustCompile(checkPattern)
      if re.MatchString(input) {
          match := re.ReplaceAllString(input, "How do you know you are $1 ?")
          response = "output : " + match
          return response
      } //if re.MatchString
  } //for pattern2
  </code></pre>
  
  <p>my output for response is "how do you know you are"</p>
  
  <p>my intended output "how do you know you are feeling happy"</p>