package main
import (
"regexp"
"fmt"
)
func main() {
var re = regexp.MustCompile(`(?m)(?i)insuficiencia[\s]{0,3}hep[Ááa]tica|fall[ao](.){0,9}funci[Óóo]n[\s]{0,3}hep[Ááa]tica|descompensaci[Óóo][\s]{0,3}hep[Ááa]tica|descompensaci[Óóo]n[\s]{0,3}hep[Ááa]tica|fall[oa][\s]{0,3}hep[Ááa]tic[ao]|disfunci[Óóo]n[\s]{0,3}hep[Ááa]tica|deterioro(.){0,8}funci[Óóo]n[\s]hep[Ááa]tica`)
var str = `insuficiencia hepática
falla de la función hepática
fallo de funcion hepatica
fallo de funcion hepÁtica
descompensación hepática
falla hepática
fallo hepatico
disfuncion hepatica
deterioro de la funcion hepatica
`
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/