package main
import (
"regexp"
"fmt"
)
func main() {
var re = regexp.MustCompile(`(?m)^[\d\.]+\s+(\S+)`)
var str = `2.0 HSD-U 664-999-01 c301036 1251-A 5445
ChanBoard0 233-455-00 c303bb6 1521-A 5445
ChanBoard1 321-493-00 c303496 1321-A 5445
6.0 DC-07 888-375-02 0C31F8F1 1330-A 5445
aka: 604-375-00
DC-07 123-456-01 0C6203EF 1150-A 5445
aka: 939-420-00
7.0 DC-07 613-493-00 c303496 1321-A 5445
aka: 466-456-65
DC-07 613-493-00 c303496 1321-A 5545`
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/