"fmt"
)
func main() {
var re = regexp.MustCompile(`(?m)(?<=\").+?(?=\")`)
var str = `gsdgsdgsd"test" dsgsdg dsgsdg sssssssssssssssssssssssssss`
for i, match := range re.FindAllString(str, -1) {
fmt.Println(match, "found at index", i)
}
}
там кнопка есть generate code
panic: regexp: Compile((?m)(?<=\").+?(?=\")): error parsing regexp: invalid or unsupported Perl syntax: (?< goroutine 1 [running]: regexp.MustCompile(0x12a16e, 0x14, 0x40c130, 0x0) /usr/local/go/src/regexp/regexp.go:272 +0x180 main.main() /tmp/sandbox343193120/main.go:9 +0x40 Program exited.
Обсуждают сегодня