From: utzoo!decvax!harpo!floyd!vax135!ariel!hou5f!npoiv!npois!houxm!houxa!houxi!houxz!ihnp4!ixn5c!inuxc!pur-ee!davy Newsgroups: net.lang.c Title: Grep routine - (nf) Article-I.D.: pur-ee.832 Posted: Wed Mar 9 22:26:39 1983 Received: Fri Mar 11 03:44:41 1983 #N:pur-ee:15500012:000:979 pur-ee!davy Mar 9 22:16:00 1983 Has anyone out there got a subroutine which performs the task which "grep" or (preferably) "egrep" does? Basically, I want a subroutine which I can call like: grep(fd, pattern, begin, end) int fd; char *pattern; int *begin, *end; where: fd is a file descriptor to the file in question pattern is the regular expression begin is the byte position in the file at which to start end is the byte position in the file at which to end and the routine stores the beginning and ending byte positions of the matching string in begin and end when it finds it. I realize that this stuff could be swiped out of an editor source, or that grep itself could be modified, but if someone has already done this, I'm not going to reinvent the wheel. If you have a routine similar to what I want, or know of one, please mail me at: decvax!pur-ee!davy ucbvax!pur-ee!davy ihnss!pur-ee!davy inuxc!pur-ee!davy Reach out and GREP someone, --Dave Curry