[go-nuts] Re: Find a string in a file and delete all occurences in the file

2017-04-23 Thread Ishan Jain
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

[go-nuts] Re: Find a string in a file and delete all occurences in the file

2017-04-23 Thread Ishan Jain
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 > } >