You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by "Matthew M. Boedicker" <mb...@mboedick.org> on 2005/11/07 17:20:03 UTC

[users@httpd] AliasMatch regular expression grouping

The documentation for AliasMatch refers to "standard regular expressions"
but is there any reference for exactly what syntax is allowed in AliasMatch
directives?

Is there a non-grouping version of parentheses, where the contents are
not saved for later substitutions? Like (?:) in the Python re module.

Is there any way to specify an optional group by following it with a
question mark such as:

AliasMatch "^/a/b/(c/)?d" /x/y/z

Thanks,
-- 
Matthew M. Boedicker http://mboedick.org

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] AliasMatch regular expression grouping

Posted by Joshua Slive <js...@gmail.com>.
On 11/7/05, Matthew M. Boedicker <mb...@mboedick.org> wrote:
> The documentation for AliasMatch refers to "standard regular expressions"
> but is there any reference for exactly what syntax is allowed in AliasMatch
> directives?
>
> Is there a non-grouping version of parentheses, where the contents are
> not saved for later substitutions? Like (?:) in the Python re module.
>
> Is there any way to specify an optional group by following it with a
> question mark such as:
>
> AliasMatch "^/a/b/(c/)?d" /x/y/z

If you are using 2.x, then the answer is here:
http://httpd.apache.org/docs/2.0/glossary.html#regex
Apache uses PCRE (the same library used by python, if my memory serves
me correctly).

In 1.3, regex is provided either by the HSRegex library, or by your
systems extended regex library, depending on how it is compiled.  The
regexes are less powerful, resembling what you get in egrep.

Joshua.

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org