You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Randy Terbush <ra...@zyzzyva.com> on 1997/06/26 05:23:41 UTC
Re: regex syntax
Without deep knowledge of why we had to use ~ to invoke the regex
parsing, why do we need to have any kind of distinction. It would
be more intuitive to me to allow the regex without any special
directives or ~ switches.
> Recently, I submitted a patch to add regex capabilities to Alias,
> ScriptAlias and Redirect. It has enough votes to be commited. However,
> I was thinking about this, and I'm wondering if a different syntax
> should be used than the one I did.
>
> I based it on the other example in Apache where regexes are used in
> the same place normal strings are, <Directory>, <File>, etc... These
> work as follows:
>
> <Directory ~ regex>
>
> This is sort of based on the Perl ~= construct, and distinguishes to
> the server a regular expression from a normal string. So my patch uses
> the same syntax in mod_alias, e.g.
>
> Alias ~ regex filename
>
> I'm wondering if this is such a good idea. It's less than intuitive,
> and gives the server less understanding of the arguments to
> Alias/Redirect. And it gets especially ugly if you throw three args to
> Redirect, e.g.
>
> Redirect ~302 regex filename
>
> I'm now thinking that it would be better to have seperate directivs,
> e.g. AliasRegex/ScriptAliasRegex/RedirectRegex, which take the exact
> same arguments as their non-regex cousins, e.g.
>
> AliasRegex regex filename
>
> Perhaps we should even depreciate the ~ syntax in the <> segments, and
> add <DirectoryRegex>, <LocationRegex>, etc... directives.
>
> Does anyone have any thoughts on the matter?
>
> --
> ________________________________________________________________________
> Alexei Kosut <ak...@nueva.pvt.k12.ca.us> The Apache HTTP Server
> URL: http://www.nueva.pvt.k12.ca.us/~akosut/ http://www.apache.org/