package main
import (
"regexp"
"fmt"
)
func main() {
var re = regexp.MustCompile(`(?m)(^(13|24|28)\d{6}$)|(^\d{2}(55|99)\d{4}$)|(^\d{4}(20|21)\d{2}$)|(^\d{6}(42|38|09|17|66)$)`)
var str = `12345678
13345678
12555678
12342078
12345666`
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/