summaryrefslogtreecommitdiff
path: root/zwgc/regexp.c
diff options
context:
space:
mode:
authorGravatar Marc Horowitz <marc@mit.edu>1989-11-01 20:02:01 +0000
committerGravatar Marc Horowitz <marc@mit.edu>1989-11-01 20:02:01 +0000
commitd13d8a046838ce3d0e2643bb5b49f2ff77d679ca (patch)
tree05737bc11e3461836ce817939b9129ed58545ac7 /zwgc/regexp.c
parentfd994e4099ad66fb3bf26cd636ca5d5cae72da68 (diff)
Initial revision
Diffstat (limited to 'zwgc/regexp.c')
-rw-r--r--zwgc/regexp.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/zwgc/regexp.c b/zwgc/regexp.c
new file mode 100644
index 0000000..8e02b8a
--- /dev/null
+++ b/zwgc/regexp.c
@@ -0,0 +1,24 @@
+#include <stdio.h>
+#include "regexp.h"
+
+extern char *re_comp();
+extern int re_exec();
+
+int ed_regexp_match_p(test_string, pattern)
+ string test_string;
+ string pattern;
+{
+ char *comp_retval;
+ int exec_retval;
+
+ if (comp_retval = re_comp(pattern)) {
+ fprintf(stderr,"%s in regex %s\n",comp_retval,pattern);
+ return(0);
+ }
+ if ((exec_retval=re_exec(test_string)) == -1) {
+ fprintf(stderr,"Internal error in re_exec()");
+ return(0);
+ }
+
+ return(exec_retval);
+}