title: regexp value compared to string
body: <pre><code>func main() {
  
      var ip string
      fmt.Print("Host: ")
      fmt.Scanln(&amp;ip)
  
      addr, _ := net.LookupAddr(ip)
  
      app := "grep"
      arg0 := "inst"
      arg1 := "acl.yaml"
  
      cmd := exec.Command(app, arg0, arg1)
      stdout, err := cmd.Output()
      x := string(stdout)
  
      reg, _ := regexp.Compile(`(internal)`)
      if err != nil {
          println(err.Error())
          return
      }
      if ip != "" {
          validateIP(ip)
      }
      fmt.Println(x)
      fmt.Println(addr[0])
      //fmt.Println(stdout)
      if addr[0] == reg.FindString(`(internal)`){
          file, err := os.Open("ports.json")
          if err != nil {
              panic(err)
          }
          defer file.Close()
          ports := []portDef{}
          err = json.NewDecoder(file).Decode(&amp;ports)
          if err != nil {
              panic(err)
          }
  
          for _, p := range ports {
              conn, err := net.Dial(p.Protocol, ip + ":" + p.Port)
              if conn != nil {
                  fmt.Println("")
                  fmt.Printf("Connection established between %s and Localhost.\n", addr)
                  fmt.Printf("Remote Address : %s \n", conn.RemoteAddr().String())
                  fmt.Printf("Local Address : %s \n", conn.LocalAddr().String())
              }
              fmt.Println("")
              if err != nil {
                  fmt.Println(err)
              }
          }
      }
  }
  </code></pre>
  
  <p>I am trying to compare a regexp value to a string. In this case I want the value of <code>"addr"</code> to be compared to the regex and if the value of <code>addr</code> has "internal" in it that it opens the selected file and iterates through the ports. The address returned from the <code>LookupAddr</code> is always in box.internal.blah.blah.com, so I am looking for the second field in the address (internal in this case) to be compared to the regex and if it finds "internal" in the address it will cycle through the loop. </p>
  
  <p>I know my regexp is most likely what is wrong here. Any help would be greatly appreciated.   </p>