package main
import (
"regexp"
"fmt"
)
func main() {
var re = regexp.MustCompile(`<p>(?:(?!本报记者)[^<>])*?本报记者[^<>]*</p>`)
var str = `接口的时间段是是的啊<p>本报记者ddfsd 网思想家</p>到家咯会计法
`
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/