httpd-modules-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ross Heritage <>
Subject Re: Regex Help with Mod Rewrite
Date Tue, 21 Aug 2007 16:34:38 GMT
Hi Soumya,

Yep, for the future you probably want the user support list (

However, to be helpful I think the answers to your questions would be

1) Apache 1.3 uses POSIX based regular expressions, and apache 2.x uses the
PCRE library, so they're perl compatible.

RewriteCond %{QUERY_STRING}
RewriteRule . - [E=OPERATION:%2]

There are lots of ways to optimise the above, but I've kept it to something
relatively simple for easy reading...
If you wanted anything more complicated than that in a single rule, I'd
suggest looking at writing your own internal map function. This list could
help you with that.


Ross Heritage.

On 21/8/07 17:04, "Soumya Sanyal" <> wrote:

> Hello,
>  This might not be the most appropriate forum to field this question - but
> I'm having serious issues with the formulation of a regex for Mod Rewrite. I
> actually have a couple of questions to ask :
> 1> What is particular flavor of the regex engine being used by Mod Rewrite -
> there are ever so slight variations in the different regex engines, e.g.
> linux grep vs perl grep etc.
> 2> I'm having trouble formulating a good compact regex to represent the
> following problem :
> I want my RewriteCond to be conditioned on the %{QUERY_STRING} to contain
> only the powerset of a group of words e.g.
> Hence if my set is say {rain,spain,plain}
> The RewriteCond should say yes to the following :
> But not :
> Help please ?

View raw message