package main
import (
"regexp"
"fmt"
)
func main() {
var re = regexp.MustCompile(`(\w+)`)
var str = `"1 2013-07-25 11599" CLOSED
"2 2013-07-25 256" PENDING_PAYMENT
"3 2013-07-25 12111" COMPLETE
"4 2013-07-25 8827" CLOSED
"5 2013-07-25 11318" COMPLETE
"6 2013-07-25 7130" COMPLETE
"7 2013-07-25 4530" COMPLETE
"8 2013-07-25 2911" PROCESSING
"9 2013-07-25 5657" PENDING_PAYMENT
"10 2013-07-25 5648" PENDING_PAYMENT
"11 2013-07-25 918" PAYMENT_REVIEW
"12 2013-07-25 1837" CLOSED
`
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/