package main
import (
"regexp"
"fmt"
)
func main() {
var re = regexp.MustCompile(`(?m)^(0(?:[123]|{.+?})+0)`)
var str = `01232231{whatever 3 gArBaGe? I want.}121{foo}2310312{bar}3120123
01212121{hello 0}121312
01213123123123{21310030123012301}31231230123`
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/