I've had several occasions where basic RE just couldn't do what I
needed and I've longed for full extended REs. That was my initial
impetus to getting the SE Toolkit environment to build. What are
others thoughts on using regcomp/regexec over compile/step to enable
extended regular expressions. I've got a patch that implements this.
gunthar:/lcl/svn/setoolkit/trunk/se> diff -e run.c.orig run.c
2814a
*/
if ((reg_status=regcomp(&re, right.var_un.var_string,
REG_EXTENDED|REG_NOSUB))!= 0)
se_fatal("compile failed: op \"=~\", reason=%d", reg_status);
reg_status = regexec(&re, left.var_un.var_string, (size_t) 0, NULL, 0);
regfree(&re);
return reg_status != 0;
.
2811a
/*
.
2808a
*/
if ((reg_status=regcomp(&re, right.var_un.var_string,
REG_EXTENDED|REG_NOSUB))!= 0)
se_fatal("compile failed: op \"=~\", reason=%d", reg_status);
reg_status = regexec(&re, left.var_un.var_string, (size_t) 0, NULL, 0);
regfree(&re);
return reg_status == 0;
.
2805a
/*
.
2775a
regex_t re;
int reg_status;
.
23c
/* #include <regexpr.h> */
#include <regex.h>
#include <sys/types.h>
.
|