package main
import (
"regexp"
"fmt"
)
func main() {
var re = regexp.MustCompile(`(?m)(?i)(?s)(?!.*?word2)^.*$`)
var str = ` abcd_test.py
test.py
xyz_test.js
test.js
asdsad.sad
sad asd
word dkkdk mfkmkf
lkdskdlk word2
ghhg hjkh
`
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/