httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Bill Stoddard" <b...@wstoddard.com>
Subject PCRE and regex question...
Date Thu, 07 Jun 2001 20:17:10 GMT
Is there a quick way I can check a string to see if it is a regex or not?

I am looking at extending SetEnvIf to accept a regex on the 'header' argument (value may
already be a regex).  My first cut replaces this call in mod_setenvif:

    val = apr_table_get(r->headers_in, b->name);

    where b->name is a nonregex header name

with code that iterated through r->headers_in doing an ap_regex on each under the
assumption that b->name -may- be a regex.  The problem with this is the unnecessary
performance hit on all requests when the b->name is NOT a regex (and where apr_table_get()
will do the right thing).

pcre_infofull() seems a likely candidate but it is not clear to me which field to check


Bill


Mime
View raw message