package main
import (
"regexp"
"fmt"
)
func main() {
var re = regexp.MustCompile(`(?m)<[^>]*>\s*$`)
var str = `<ABZ>-<BOS>-<Mon Dec 28 11:20:00 UTC 2015>-<Mon Dec 28 18:05:00 UTC 2015>-<EI>-<3241>-<EI>-<139>-<USBR>-<ROUND>-<GBP>
<ABZ>-<BOS>-<Mon Jan 04 11:20:00 UTC 2016>-<Mon Jan 04 18:05:00 UTC 2016>-<EI>-<3241>-<EI>-<139>-<NONE>-<ONEWAY>-<GBP>
<ABZ>-<BOS>-<Mon Jan 04 11:20:00 UTC 2016>-<Mon Jan 04 18:05:00 UTC 2016>-<EI>-<3241>-<EI>-<139>-<NONE>-<ROUND>-<USD>
<ABZ>-<BOS>-<Mon Jan 04 11:20:00 UTC 2016>-<Mon Jan 04 18:05:00 UTC 2016>-<EI>-<3241>-<EI>-<139>-<NSNS>-<ROUND>-<GBP>
<ABZ>-<BOS>-<Mon Jan 04 11:20:00 UTC 2016>-<Mon Jan 04 18:05:00 UTC 2016>-<EI>-<3241>-<EI>-<139>-<USBC>-<ONEWAY>-<GBP>
<ABZ>-<BOS>-<Mon Jan 04 11:20:00 UTC 2016>-<Mon Jan 04 18:05:00 UTC 2016>-<EI>-<3241>-<EI>-<139>-<USBC>-<ROUND>-<GBP>
<ABZ>-<BOS>-<Mon Jan 04 11:20:00 UTC 2016>-<Mon Jan 04 18:05:00 UTC 2016>-<EI>-<3241>-<EI>-<139>-<USBC>-<ROUND>-<USD>`
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/