package main
import (
"regexp"
"fmt"
)
func main() {
var re = regexp.MustCompile(`(?m)\s1[A-Za-z]`)
var str = `-ABC046Y 1SMITH/FREDMR
.L/JCD5CQ
.R/TKNE HK1 6002300348396/1-SMITH/FREDMR
.R/SEAT HK1 9F
.R/FQTV AB 60042576-1SMITH/FREDMR 1DOE/JANEMISS
.L/JC93QW
.R/TKNE HK1 6002300219029/2-1DOE/JANEEMISS
.R/SEAT HK1 8A
.R/CHKD HK1 011-1DOE/JANEMISS 1PRESLEY/ELVISMR-A2 `
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/