package main
import (
"regexp"
"fmt"
)
func main() {
var re = regexp.MustCompile(`(?m)[^&]_*\s*(SF)*\d{8}`)
var str = `_zz&69050398_5d147597dd4aca00014351d9_zz sf 76064603RPL_Import_Create
_zm&69396284_5d165ed60198d60001fbef9a_75946292_Import
_aa&69385775_5d15782bdd4aca0001435432_supplier_info_import_template
_aa&68936210_5d16581add4aca00014355e9_76005473 RPL_Import_Create_Stand_to_Package
_ac&68728692_5d18fa52dd4aca00014356dd_SF 76113839 Copy of Generic_Export_AdvancePR_result - 2019-06-30T200450.090`
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/