httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alexei Kosut <>
Subject Re: b11 + mod_perl + BrowserMatch
Date Sat, 31 May 1997 07:19:12 GMT
On Sat, 31 May 1997, Rasmus Lerdorf wrote:

> There are still compatibility differences between hsregex and
> conventional Posix regex libs though. For example. This bit of code only
> works with hsregex:
>         subs[0].rm_so = i;
>         subs[0].rm_eo = l;
>         err = regexec(&re, string, (size_t)NS, subs, REG_STARTEND);
> To do the same thing with the stock system regex libs on most OS'es you
> would need to do something like:

That's not a "compatibility difference," it's a feature of the Spencer
regex package. The code you give for "stock" regexes works with
Spencers, right? As far as I'm aware, the POSIX regex spec doesn't
specify REG_STARTEND, that's a Spencerism.


> Yes, this is a recurring problem with mod_php.  If when libphp.a is
> compiled for hsregex and Apache is linked with the system's Posix regex or
> vice versa, httpd consistently core dumps.  I have warnings about this all
> over the PHP installation telling people to make sure that if they tell
> PHP they are going to be using hsregex, to specifically set WANTHSREGEX in
> the Apache Configuration file to 'yes'.  And to 'no' if they compile PHP
> to use the system regex lib.

Hmm. We should change this for the Apache 2.0 API: Don't let modules
call any of the regex functions by hand. Wrap them in Apache
functions. Even though could just be

int apache_regexec(regex_t *preg, char *string, size_t nmatch, regmatch_t
                   pmatch[], int eflags) {
    regexec(preg, string, nmatch, pmatch, eflags);

it would make life easier for you and other writers of large
module-libraries, right?

Alexei Kosut <>      The Apache HTTP Server

View raw message