package main
import (
"regexp"
"fmt"
)
func main() {
var re = regexp.MustCompile(`(?m)^(?!cm1[12]$)(cm[1-5]|cm1[3-7]|cm99|ig[2-3]|ig[6-7]|me3|rm[1-9]|rm1[0-9]|rm20|ss0|ss1[1-7]|ss2|ss22|ss[4-9]|ss99)$`)
var str = `cm12
cm11
cm99
cm15
cm67
cm6
ss0
ss12
cm12
ss62
`
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/