package main
import (
"regexp"
"fmt"
)
func main() {
var re = regexp.MustCompile(`(?m)(local commercial|locaux commerciaux)`)
var str = `REGEX_1 = (local commercial|locaux commerciaux)
REGEX_2NOT =
(à proximité (commerces|
commerces? proche|
commerces? [aà] proximit[ée]|
[aà] proximit[ée](\s\w*)? des? commerces?)
[Encapsuler xxx]
local commercial
locaux commerciaux
[NE PAS TENIR COMPTE]
à proximité (commerces, restaurants)
commerces? proche
commerces? à proximité
à proximité de commerces?
à proximité immédiate des commerces?`
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/