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

Reply via email to