package main
import (
"regexp"
"fmt"
)
func main() {
var re = regexp.MustCompile(`(?m)(^.*?((?:[A-Za-z]+_)+[A-Z]\w+)(?:-([0-9]{8}-[0-9]{6})-([0-9]{8}-[0-9]{6}))?)`)
var str = `mixexecutor:check_atom_exists:740 - requested to check this machine : ET_colBackDDW_Temp
output_of_reports/PII/36478_ABP_BAL_liquidpressure-20210831-123456-20210831-172355.bat.yz
packofexecutors:_to_signle_que:869-no mata for file'/private/external_control_time_mapped_low_volume/IBA/54378_BD-RT_69-1-1-20200831-152355-20200831-172355.dat.xz'
packofexecutors:_to_signle_que:869-no mata for file'/private/external_control_time_mapped_low_volume/IBA/54378_BD-RT_69-1-20200831-152355-20200831-172355.dat.xz'
mixexecutor:check_atom_exists:740 - requested to check this machine : Eanes_colBack12_current
packofexecutors._check_tar.587-nr of missed files=78 nr of skipped records=6547 nr of records not exist=0
packofexecutors._filter_mistacl_signals:777 - invalid atomname for RT_6:ESmotormeaninfAmkl`
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/