httpd-modules-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "David Wortham" <djwort...@gmail.com>
Subject Re: Regex Help with Mod Rewrite
Date Tue, 21 Aug 2007 16:34:47 GMT
Soumya,
   This is, in fact, not the correct place to ask such a question.  I would
direct you to an Apache administrators forum or perhaps try searching the
web or message boards/forums/groups for "mod_rewrite help".

www.RegularExpressions.info is always a good place to start for help with
specific issues with most flavors of RegEx.

Without knowing more of the specifics of your RewriteCond restrictions... I
would say you want something like "(rain,?|spain,?|plain,?)*"
Disclaimer: I did not test this Regex before responding and I know that you
can end up with a few false-positive conditions (like when your query string
params are not separated by commas)

I would venture a guess that Apache uses the PCRE flavor of regex, but I am
willing to bet you will find help which directly concerns mod_rewrite more
useful than general PCRE RegEx help.

Hope this helps.


Dave





On 8/21/07, Soumya Sanyal <soumya.sanyal@gmail.com> 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 :
> http://foo.bar.com/?Operation=rain,spain
> http://foo.bar.com/?Operation=plain,rain,rain
> http://foo.bar.com/?Operation=plain,rain,spain
>
> But not :
> http://foo.bar.com/?Operation=rain,spain,mainly
>
> Help please ?
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message