summaryrefslogtreecommitdiff
path: root/zwgc/regexp.c
diff options
context:
space:
mode:
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);
+}