package main
import (
"regexp"
"fmt"
)
func main() {
var re = regexp.MustCompile(`(?m).*(?<!_[0sml])\.jpg$`)
var str = `9Uikt/ifehr54mg__0.jpg
9Uikt/idg4hdmg2_s.jpg
9Uikt/igdffgggfmg4_m.jpg
9Uikt/img3teg3gegg7_l.jpg
9Uikt/imgerhw45h70.jpg
9Uikt/imggq4ge37s.jpg
9Uikt/img3f37m.jpg
9Uikt/img34g3f7l.jpg
9Uikt/imgf3f34t4t73l_.jpg
9Uikt/imgf3f34t4t73l_2.jpg`
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/