httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Scott Lamb <>
Subject Re: Fixing BrowserMatch: multi-string search algorithms?
Date Tue, 07 May 2002 00:16:30 GMT
Brian Pane wrote:
> Given a set of n BrowserMatch directives (as in,
> for example, the default config that we ship with
> httpd-2.0), mod_setenvif will do O(n) regex comparisons
> on every request.
> I want to fix that.


> Does anyone know of an efficient algorithm for comparing
> an input string against a set of multiple pattern strings?

I suggest creating a new regular expression which is each of the ones in 
the list separated by '|'. It will use regular expression alternatives 
to match multiple patterns with a single state machine. And add almost 
no code.

Scott Lamb

View raw message