I'm trying to read each line from a particular string and then match then against a pattern, but I keep getting the error in the SS, here's the code:
decipherMap :: proc(mapFile: string) -> int {
lines : []string = strings.split_lines(mapFile)
regex :string =
"(one" +
"|two" +
"|three" +
"|four" +
"|five" +
"|six" +
"|seven" +
"|eight" +
"|nine" +
"|\\d)"
matches : ^match.Match
for line in lines {
match.gmatch(line, regex, matches)
fmt.println(line)
}
return 0
}
Does anyone know how I could make this work? I have no idea how to turn line into a pointer nor how to instantiate a variable of type ^[32]Match so I can use the gmatch procedure, any help is appreciated