I created a small program to demonstrate this.
As go playground doees not supports files and stuff so I put all the content of
file in an array and iterated through that. You can read the file and iterate
through ReadBuffer Line by line to get the same results.
Go playground link:
https://play
won't match a word in a bigger word.
> regex, err := regexp.Compile(`\b` + v + `\b`)
> if err != nil {
> log.Panic("Error In Compiling Regex")
> }
> if len(regex.FindAllString(str, 1)) != 0 {
> return true
> }
>