package main
import (
"regexp"
"fmt"
)
func main() {
var re = regexp.MustCompile(`(?m)^[A|C][1-9|A-HJ-PR-UW-Y][0-9][1-9|A-C][1-9|A-HJ-PR-UW-Y][0-9|A-HJ-PR-UW-Y]{3}[A-HJ-PR-UW-Y]{2}`)
var str = `A131K062CE04
A131K062CA04
A131K062CA
A131K062CE
A131K062CE
AZ31K062CE04
A136P099BH
A136Q09YBK
A136S02QCE
A136R09QAY
A136F04QBV
A136F08QAB
C136Q03UAU
A136D05BCG
A136B041AQ`
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/