You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Alexei Kosut <ak...@organic.com> on 1996/07/29 04:41:51 UTC

pregsub()

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 <ak...@organic.com>            The Apache HTTP Server 
   http://www.nueva.pvt.k12.ca.us/~akosut/      http://www.apache.org/