From 785365904d7e4bd8c122f4ca9c9f52b5768c92e9 Mon Sep 17 00:00:00 2001 From: Graham Leggett Date: Mon, 30 Dec 2013 19:52:42 +0000 Subject: [PATCH] Documentation for the support of named groups and backreferences. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1554301 13f79535-47bb-0310-9956-ffa450edef68 --- docs/manual/mod/core.xml | 39 +++++++++++++++++++++++++++++++++++ docs/manual/mod/mod_proxy.xml | 13 ++++++++++++ docs/manual/sections.xml | 12 +++++++++++ 3 files changed, 64 insertions(+) diff --git a/docs/manual/mod/core.xml b/docs/manual/mod/core.xml index df059a1741..6e3c2ff9c8 100644 --- a/docs/manual/mod/core.xml +++ b/docs/manual/mod/core.xml @@ -885,6 +885,19 @@ the contents of file-system directories matching a regular expression. + +

From 2.5.0 onwards, named groups and backreferences are captured and + written to the environment with the corresponding name in upper case. + This allows elements of paths to be referenced from within + expressions and modules like + mod_rewrite. In order to prevent confusion, numbered + (unnamed) backreferences are ignored. Use named groups instead.

+ + +<DirectoryMatch ^/var/www/combined/(?<SITENAME>[^/]+)> + require ldap-group cn=%{env:SITENAME},ou=combined,o=Example +</DirectoryMatch> + Directory for a description of how regular expressions are mixed in with normal @@ -1735,6 +1748,19 @@ filenames

would match most common Internet graphics formats.

+ +

From 2.5.0 onwards, named groups and backreferences are captured and + written to the environment with the corresponding name in upper case. + This allows elements of files to be referenced from within + expressions and modules like + mod_rewrite. In order to prevent confusion, numbered + (unnamed) backreferences are ignored. Use named groups instead.

+ + +<FileMatch ^(?<SITENAME>[^/]+)> + require ldap-group cn=%{env:SITENAME},ou=combined,o=Example +</FileMatch> + How <Directory>, <Location> @@ -2688,6 +2714,19 @@ matching URLs

would match URLs that contained the substring /extra/data or /special/data.

+ +

From 2.5.0 onwards, named groups and backreferences are captured and + written to the environment with the corresponding name in upper case. + This allows elements of URLs to be referenced from within + expressions and modules like + mod_rewrite. In order to prevent confusion, numbered + (unnamed) backreferences are ignored. Use named groups instead.

+ + +<LocationMatch ^/combined/(?<SITENAME>[^/]+)> + require ldap-group cn=%{env:SITENAME},ou=combined,o=Example +</LocationMatch> + How <Directory>, <Location> diff --git a/docs/manual/mod/mod_proxy.xml b/docs/manual/mod/mod_proxy.xml index 95389b0b78..cbec774005 100644 --- a/docs/manual/mod/mod_proxy.xml +++ b/docs/manual/mod/mod_proxy.xml @@ -528,6 +528,19 @@ proxied resources identical to the Proxy directive, except it matches URLs using regular expressions.

+ +

From 2.5.0 onwards, named groups and backreferences are captured and + written to the environment with the corresponding name in upper case. + This allows elements of URLs to be referenced from within + expressions and modules like + mod_rewrite. In order to prevent confusion, numbered + (unnamed) backreferences are ignored. Use named groups instead.

+ + +<ProxyMatch ^http://(?<SITENAME>[^/]+)> + require ldap-group cn=%{env:SITENAME},ou=combined,o=Example +</ProxyMatch> + Proxy diff --git a/docs/manual/sections.xml b/docs/manual/sections.xml index b3c93b7574..76eeb53d32 100644 --- a/docs/manual/sections.xml +++ b/docs/manual/sections.xml @@ -296,6 +296,18 @@ at once:

</FilesMatch> +

Regular expressions containing named groups and +backreferences are added to the environment with the +corresponding name in uppercase. This allows elements of filename paths +and URLs to be referenced from within expressions +and modules like mod_rewrite.

+ + +<DirectoryMatch ^/var/www/combined/(?<SITENAME>[^/]+)> + require ldap-group cn=%{env:SITENAME},ou=combined,o=Example +</DirectoryMatch> + +
Boolean expressions -- 2.40.0