package main
import (
"regexp"
"fmt"
)
func main() {
var re = regexp.MustCompile(`(?m)(?i)\b(?:Store Number|StreetA|City|State_id|Postal Code|Store Name|Phone Number|Tax Table \d|Artistree Vendor|Store Group|Store Zone number)+\b\s*[–,-]\s*(\w*.*)`)
var str = `FP Team,
Please install the Live database for store 1384. The updates have been completed.
• Store number - 1384
• StreetA – 1275 York Rd, Ste 21A
• City – Gettysburg
• State_id – PA
• Postal Code – 17325-7565
• Store Name – Gettysburg, PA
• Phone Number – (717) 420-8200
• Tax Rates
o Tax table 1 – 6.0000%
o Tax table 2 – 0.0000%
o Tax table 3 – 0.0000%
o Tax table 4 – 0.0000%
o Tax table 5 – N/A
• Artistree vendor – Kernersville
• Store Group – US.201308
• Store Zone number – 2030`
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/