From: Stefan Fritsch If you are matching positive (/images/.*(jpg|gif)$
". Apache uses Perl
- Compatible Regular Expressions provided by the PCRE library. You can find more documentation
- about PCRE's regular expression syntax at that site, or at
+ be written as "/images/.*(jpg|gif)$
". In places where
+ regular expressions are used to replace strings, the special variables
+ $1 ... $9 contain backreferences to the grouped parts (in parentheses) of
+ the matched expression. The special variable $0 contains a backerference
+ to the whole matched expression. To write a literal dollar sign in a
+ replacement string, it can be escaped with a backslash. Historically, the
+ variable & could be used as alias for $0 in some places. This is no
+ longer possible since version 2.3.5. Apache uses Perl Compatible Regular
+ Expressions provided by the PCRE
+ library. You can find more documentation about PCRE's regular expression
+ syntax at that site, or at
Wikipedia.
diff --git a/docs/manual/glossary.xml b/docs/manual/glossary.xml
index d6d842a84f..53a7f38826 100644
--- a/docs/manual/glossary.xml
+++ b/docs/manual/glossary.xml
@@ -380,10 +380,17 @@
expressions are useful in Apache because they let you apply certain
attributes against collections of files or resources in very flexible ways
- for example, all .gif and .jpg files under any "images" directory could
- be written as "/images/.*(jpg|gif)$
". Apache uses Perl
- Compatible Regular Expressions provided by the PCRE library. You can find more documentation
- about PCRE's regular expression syntax at that site, or at
+ be written as "/images/.*(jpg|gif)$
". In places where
+ regular expressions are used to replace strings, the special variables
+ $1 ... $9 contain backreferences to the grouped parts (in parentheses) of
+ the matched expression. The special variable $0 contains a backerference
+ to the whole matched expression. To write a literal dollar sign in a
+ replacement string, it can be escaped with a backslash. Historically, the
+ variable & could be used as alias for $0 in some places. This is no
+ longer possible since version 2.3.5. Apache uses Perl Compatible Regular
+ Expressions provided by the PCRE
+ library. You can find more documentation about PCRE's regular expression
+ syntax at that site, or at
Wikipedia.
diff --git a/docs/manual/mod/mod_include.html.en b/docs/manual/mod/mod_include.html.en
index a9ff1e16ff..e54c4b8f0d 100644
--- a/docs/manual/mod/mod_include.html.en
+++ b/docs/manual/mod/mod_include.html.en
@@ -558,7 +558,8 @@
=
or ==
), you
can capture grouped parts of the regular expression. The captured parts
are stored in the special variables $1
..
- $9
.$9
. The whole string matched by the regular expression is
+ stored in the special variable $0
If you are matching positive (
<!--#if expr="$QUERY_STRING = /^sid=([a-zA-Z0-9]+)/" -->
diff --git a/docs/manual/mod/mod_include.xml b/docs/manual/mod/mod_include.xml
index 332e9fbd8c..e08204ccd3 100644
--- a/docs/manual/mod/mod_include.xml
+++ b/docs/manual/mod/mod_include.xml
@@ -547,7 +547,8 @@
=
or ==
), you
can capture grouped parts of the regular expression. The captured parts
are stored in the special variables $1
..
- $9
.$9
. The whole string matched by the regular expression is
+ stored in the special variable $0
$N
- (0 <= N <= 9), which provide access to the grouped
+ (0 <= N <= 9). $1 to $9 provide access to the grouped
parts (in parentheses) of the pattern, from the
RewriteRule
which is subject to the current
- set of RewriteCond
conditions.
+ set of RewriteCond
conditions. $0 provides
+ access to the whole string matched by that pattern.
%N
- (1 <= N <= 9), which provide access to the grouped
+ (0 <= N <= 9). %1 to %9 provide access to the grouped
parts (again, in parentheses) of the pattern, from the last matched
RewriteCond
in the current set
- of conditions.
+ of conditions. %0 provides access to the whole string matched by
+ that pattern.
$N
- (0 <= N <= 9), which provide access to the grouped
+ (0 <= N <= 9). $1 to $9 provide access to the grouped
parts (in parentheses) of the pattern, from the
RewriteRule
which is subject to the current
- set of RewriteCond
conditions.
+ set of RewriteCond
conditions. $0 provides
+ access to the whole string matched by that pattern.
%N
- (1 <= N <= 9), which provide access to the grouped
+ (0 <= N <= 9). %1 to %9 provide access to the grouped
parts (again, in parentheses) of the pattern, from the last matched
RewriteCond
in the current set
- of conditions.
+ of conditions. %0 provides access to the whole string matched by
+ that pattern.