DaniWeb IT Discussion Community

DaniWeb IT Discussion Community (http://www.daniweb.com/forums/index.php)
-   C (http://www.daniweb.com/forums/forum118.html)
-   -   Help with grep (http://www.daniweb.com/forums/thread168211.html)

jmoo5 Jan 13th, 2009 8:10 pm
Help with grep
 
Have to write a program that mimikes a grep. It has to search thru a given file for a certain pattern. I have no idea where to start. Help please.

death_oclock Jan 13th, 2009 8:15 pm
Re: Help with grep
 
grep stands for global / regular expression / print. First try a search on a way of performing regular expressions in C. Then find a good tutorial on how those work.

Salem Jan 14th, 2009 2:00 am
Re: Help with grep
 
> I have no idea where to start.
Read a file, and print it out unmodified.

Then add code to find a fixed string.

Then add code to implement each feature of a regexp in turn.

Each is a small-ish step, built on the success of the previous step.


All times are GMT -4. The time now is 5:30 am.

Forum system based on vBulletin Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
©2003 - 2009 DaniWeb® LLC