USG UNIX versions of re_comp and re_exec.

Ronald S. Woan ron at woan.austin.ibm.com
Wed Nov 15 04:04:19 AEST 1989


In article <21440 at adm.BRL.MIL>, mark at ria-emh2.army.mil (Mark D. McKame
writes:
>     I am in the process of porting a Berkeley BSD 4.2 C program to USG 5.2.
> Can anyone tell me what the functions "re_comp" and "re_exec" perform?
> Has anyone written equivalent functions for USG 5.2 UNIX?  If so, please
> e-mail me copies.  Thank You.
Here's the man description of the two functions (both under REGEX(3) in the
man pages).
	char *re_comp(s)	re_execs(s)
	char *s;		char *s;
Re_comp compiles a string into an internal form suitable for pattern matching.
Re_exec checks the argument string against the last string passed to re_comp.

Re_comp returns 0 if it is successful. If passed a 0 or null string,
it will not update the currently compiled expression.

Re_exec returns 1 if string s matches the last compiled expression, 0 if
it does not, and -1 if the last compiled expression is invalid.

Sys V implementations can be found in the source for GNU EMACS and
Perl, but they are covered by the GNU copyleft naturally, so you 
can't use them in commercial applications... Anyways, its not too
difficult to write you own.

						Ron


+-----All Views Expressed Are My Own And Are Not Necessarily Shared By------+
+------------------------------My Employer----------------------------------+
+ Ronald S. Woan  (IBM VNET)WOAN AT AUSTIN, (AUSTIN)ron at woan.austin.ibm.com +
+ outside of IBM       @cs.utexas.edu:ibmaus!auschs!woan.austin.ibm.com!ron +
+ last resort                                        woan at peyote.cactus.org +



More information about the Comp.unix.questions mailing list