package main
import (
"regexp"
"fmt"
)
func main() {
var re = regexp.MustCompile(` .+\.rtf `)
var str = `rxn of glucose.png Screen Shot 2017-07-17 at 8.25.30 AM.png Screen Shot 2017-08-18 at 11.23.21 AM.png Screen Shot 2017-08-18 at 11.36.27 AM.png Screen Shot 2017-08-19 at 6.06.19 AM.png SSS.rtf Untitled 2.rtf Untitled 3.rtf Untitled 4.rtf Untitled.rtf`
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/