package main
import (
"regexp"
"fmt"
)
func main() {
var re = regexp.MustCompile(`(?im)^([A-Z][a-z-]+),? +([A-Z])[^\n]*`)
var str = `Grundy Ronald
Domsky Alan
Amator Gary L & Kathleen N
Worden Scott Allen
Rodriguez Howard W
NEHME ALLEN
RODRIGUEZ CHARLES G
VERGARA WILLIAM F J
EVELYN J
GLICK, JACOB L.
Taylor-garcia Dottielou`
var substitution = "$2-$1"
fmt.Println(re.ReplaceAllString(str, substitution))
}
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/