package main
import (
"regexp"
"fmt"
)
func main() {
var re = regexp.MustCompile(`(?m)\b(?!TSPU\b)[A-Z]{4,}(?:(?:\s+\w\.)?\s+\w+)?`)
var str = `JINA L. CHOI (NY Bar No. 2699718)
ERIN E. SCHNEIDER (Cal. Bar No. 216114) schneidere@sec.gov
MONIQUE C. WINKLER (Cal. Bar No. 213031) winklerm@sec.gov
JASON M. HABERMEYER (Cal. Bar No. 226607) habermeyerj@sec.gov
MARC D. KATZ (Cal. Bar No. 189534) katzma@sec.gov
JESSICA W. CHAN (Cal. Bar No. 247669) chanjes@sec.gov
RAHUL KOLHATKAR (Cal. Bar No. 261781) kolhatkarr@sec.gov
The Investor Solicitation Process Generally Included a Face-to-Face Meeting, a Technology Demonstration, and a Binder of Materials [...]
TSPU or taken
TSPU or the
TSPU only
TSPU was
TSPU and`
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/