httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Randy Terbush <>
Subject Re: regex syntax
Date Thu, 26 Jun 1997 03:23:41 GMT

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 <>      The Apache HTTP Server
> URL:

View raw message