package main
import (
"regexp"
"fmt"
)
func main() {
var re = regexp.MustCompile(`(?m)^(?:[^*\n]*\*){2}([^*\n]*)`)
var str = `LLC1R.8888.GR0054656*DR.798012...2..............GR0054656*CNY*ARTIST*
TC1R.88.GR0054656*DR.765012...2..............GR0054656*EUR*LUKE*
K56R.8.GR0054656*DR.258812...4..............GR0054656*AUD*
790GG.88.GR0054656*DR.338012...5..............GR0054656*IDR*MATTHEW*
GREFD.888.GR0054656*DR.198012...6..............GR0054656*`
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/