package main
import (
"regexp"
"fmt"
)
func main() {
var re = regexp.MustCompile(`(?mi)master(\D){0,30} informatique|master [2] (\D){0,3}informatique`)
var str = `Master Informatique
master en informatique
Master Spécialité informatique
master spécialisé en informatique
(master) spécialisée en informatique
master, en électronique ou en informatique
Master en Electronique ou Informatique
Master) avec une spécialisation en informatique
Master, MIAGE...), une expérience en informatique
Master en ingénierie - spécialité en Informatique
master, en électronique ou en informatique
master II en informatique
(Master II) en Informatique
master II, informatique
Master Data / Informatique
Master MIAGE ou Informatique
master 2 en informatique
Master 2 informatique
Master), de préférence dans l’informatique
Master RH, Informatique
`
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/