package main
import (
"regexp"
"fmt"
)
func main() {
var re = regexp.MustCompile(`(?m):\s+(?<a>[^ ]+)\s+-\>\s+(?<b>[^ ]+)\s+Failure`)
var str = `Service ABCD(blabla_blabla): 365.45.1.87.3.60354 -> remote.234.5 Failure
Service DERF(blabla_blabla): remote.567.9 -> remote.284.9 Failure`
for i, match := range re.FindAllString(str, -1) {
fmt.Println(match, "found at index", i)
}
}
Please keep in mind that these code samples are automatically generated and are not guaranteed to work. If you find any syntax errors, feel free to submit a bug report. For a full regex reference for Golang, please visit: https://golang.org/pkg/regexp/