package main
import (
"regexp"
"fmt"
)
func main() {
var re = regexp.MustCompile(`(?m)(?:\*\*\*trash[0-9]+\*\*\*)(\w+\s\w+)(?:\s[^\D]+\s)`)
var str = `random text 1***trash24***y6f dhy 63 month ago 14 minutes, 29 seconds 3,620 name***trash3***random text 1","random text 2***trash2***pot 5aq 3 months ago 9 minutes, 9 seconds 226,629 name***trash3***random text 2","random text 3***trash2***uan 4fp 5 months ago 26 minutes 506,950 name***trash3***random text 3"
и тут тоже $1 то что тебе нужно
`
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/