I need to get a line from a multiline string in golang which has common word like if the word is enabled then i need the line from multiline string once enable then we will continue.. The string is Their have a problem with the server.I have to continue the task.Hope the server will enable for everyone.Once enable then we will continue. .i am trying this golang code
package main
import (
"fmt"
"regexp"
)
func main() {
s := "Their have a problem with the server.I have to continue the task.Hope the server will enable for everyone.Once enable then we will continue."
val := "enabled"
re := regexp.MustCompile(`[^.]*(?i)` + val + `[^.]*[\.| ]`)
fmt.Println(re.FindAllString(s, -1))
return
}