httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alexei Kosut <ako...@organic.com>
Subject pregsub()
Date Mon, 29 Jul 1996 02:41:51 GMT
I've added a pregsub() to util.c. It's based on the regsub() in Henry
Spencer's AT&T V8 regexp package, though different; it uses pool-allocated
strings instead of static length ones, and uses $ instead of \ as the
substitution character.

A simplified example of use:

regex_t *preg;
regmatch_t pmatch[10];

... preg = pregcomp(p, pattern, cflags)

... regexec(preg, stringtomatch, preg->re_nsub + 1, pmatch, eflags)

... pregsub(p, stringtoexpand, stringtomatch, preg->re_nsub + 1 , pmatch) 

...

Hopefully, it will be useful.

-- Alexei Kosut <akosut@organic.com>            The Apache HTTP Server 
   http://www.nueva.pvt.k12.ca.us/~akosut/      http://www.apache.org/


Mime
View raw message