package main
import (
"regexp"
"fmt"
)
func main() {
var re = regexp.MustCompile(`(?m)(\d+-\d+-\d+\s\d+:\d+:\d+,\d+)\s(\S+\s-\s\S+)\s(\w+)\s(.*)(.*)`)
var str = `2019-10-20 17:01:17,252 [//127.0.0.1/ - /envcenter/shippinglist/query_shippinglist_settings.json?productId=ap_philippines] ERROR impl.GitRepositoryInfoRemoteImpl - 请求gitlab api失败
java.io.FileNotFoundException: http://gitlab.alipay-inc.com/api/v3/projects/intl-sre-bm%2Fdevopaas-agent-id`
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/