I need to develop an application which allows tree main features: to search a text file line by line and if it finds the text then it prints the whole line, so for example lets say the text file has:
and i would run the applications with ./igrep efg then it would print efgh.
Now that first part is quite simples and i've managed to get a working version using strstr but the application must also support "gaps", so lets say for example we had the following text file:
And when you run the application with ./igrep b.ne i would print both bane and bone. And also with the following example:
If i call with ./igrep google.com then it would only print google.com.
As i said before the first part is simple, i have it working but i just don't have a clue how to go around to doing the second and trird part so any help would be most appreciated.
Edited 4 Years Ago by Aterin: Typo