From e04102ffe64a1335b2df5743cc9bb567d646d232 Mon Sep 17 00:00:00 2001 From: Joshua Slive Date: Wed, 12 Mar 2008 16:22:20 +0000 Subject: [PATCH] Make the RewriteRule docs shorter (!) by referencing the regex docs in the rewrite intro. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@636398 13f79535-47bb-0310-9956-ffa450edef68 --- docs/manual/mod/mod_rewrite.html.en | 48 ++-------------------- docs/manual/mod/mod_rewrite.xml | 49 ++--------------------- docs/manual/rewrite/rewrite_intro.html.en | 11 +++-- docs/manual/rewrite/rewrite_intro.xml | 11 +++-- 4 files changed, 22 insertions(+), 97 deletions(-) diff --git a/docs/manual/mod/mod_rewrite.html.en b/docs/manual/mod/mod_rewrite.html.en index 661c8c51f4..2a0d1a73ef 100644 --- a/docs/manual/mod/mod_rewrite.html.en +++ b/docs/manual/mod/mod_rewrite.html.en @@ -1086,50 +1086,10 @@ later %{QUERY_STRING} variables respectively.

- - -

Some hints on the syntax of regular - expressions:

- -
-Text:
-  .           Any single character
-  [chars]     Character class: Any character of the class ``chars''
-  [^chars]    Character class: Not a character of the class ``chars''
-  text1|text2 Alternative: text1 or text2
-
-Quantifiers:
-  ?           0 or 1 occurrences of the preceding text
-  *           0 or N occurrences of the preceding text (N > 0)
-  +           1 or N occurrences of the preceding text (N > 1)
-
-Grouping:
-  (text)      Grouping of text
-              (used either to set the borders of an alternative as above, or
-              to make backreferences, where the Nth group can 
-              be referred to on the RHS of a RewriteRule as $N)
-
-Anchors:
-  ^           Start-of-line anchor
-  $           End-of-line anchor
-
-Escaping:
-  \char       escape the given char
-              (for instance, to specify the chars ".[]()" etc.)
-
- -

For more information about regular expressions, have a look at the - perl regular expression manpage ("perldoc - perlre"). If you are interested in more detailed - information about regular expressions and their variants - (POSIX regex etc.) the following book is dedicated to this topic:

- -

- Mastering Regular Expressions, 2nd Edition
- Jeffrey E.F. Friedl
- O'Reilly & Associates, Inc. 2002
- ISBN 0-596-00289-0
-

+

For some hints on regular + expressions, see + the mod_rewrite + Introduction.

In mod_rewrite, the NOT character ('!') is also available as a possible pattern diff --git a/docs/manual/mod/mod_rewrite.xml b/docs/manual/mod/mod_rewrite.xml index 62234517a1..c68253f4a5 100644 --- a/docs/manual/mod/mod_rewrite.xml +++ b/docs/manual/mod/mod_rewrite.xml @@ -1097,51 +1097,10 @@ RewriteRule ^/$ /homepage.std.html [L] %{QUERY_STRING} variables respectively.

- - -

Some hints on the syntax of regular - expressions:

- -
-Text:
-  .           Any single character
-  [chars]     Character class: Any character of the class ``chars''
-  [^chars]    Character class: Not a character of the class ``chars''
-  text1|text2 Alternative: text1 or text2
-
-Quantifiers:
-  ?           0 or 1 occurrences of the preceding text
-  *           0 or N occurrences of the preceding text (N > 0)
-  +           1 or N occurrences of the preceding text (N > 1)
-
-Grouping:
-  (text)      Grouping of text
-              (used either to set the borders of an alternative as above, or
-              to make backreferences, where the Nth group can 
-              be referred to on the RHS of a RewriteRule as $N)
-
-Anchors:
-  ^           Start-of-line anchor
-  $           End-of-line anchor
-
-Escaping:
-  \char       escape the given char
-              (for instance, to specify the chars ".[]()" etc.)
-
- -

For more information about regular expressions, have a look at the - perl regular expression manpage ("perldoc - perlre"). If you are interested in more detailed - information about regular expressions and their variants - (POSIX regex etc.) the following book is dedicated to this topic:

- -

- Mastering Regular Expressions, 2nd Edition
- Jeffrey E.F. Friedl
- O'Reilly & Associates, Inc. 2002
- ISBN 0-596-00289-0
-

+

For some hints on regular + expressions, see + the mod_rewrite + Introduction.

In mod_rewrite, the NOT character ('!') is also available as a possible pattern diff --git a/docs/manual/rewrite/rewrite_intro.html.en b/docs/manual/rewrite/rewrite_intro.html.en index 0fd0f0faa4..decc55a979 100644 --- a/docs/manual/rewrite/rewrite_intro.html.en +++ b/docs/manual/rewrite/rewrite_intro.html.en @@ -97,7 +97,7 @@ well as write your own.

Example -.Matches any +.Matches any single characterc.t will match cat, cot, cut, etc. +Repeats the previous match one or more @@ -122,11 +122,14 @@ For more on backreferences see below. [ ]A character class - matches one of the charactersc[uoa]t matches cut, cot or cat. -!NotNegates a match - that is, -ensures that it does not match. - +[^ ]Negative character class - matches any character not specifiedc[^/]t matches cat or c=t but not c/t +

In mod_rewrite the ! character can be +used before a regular expression to negate it. This is, a string will +be considered to have matched only if it does not match the rest of +the expression.

+

Regex Back-Reference Availability

diff --git a/docs/manual/rewrite/rewrite_intro.xml b/docs/manual/rewrite/rewrite_intro.xml index 760759303e..901a6e38e9 100644 --- a/docs/manual/rewrite/rewrite_intro.xml +++ b/docs/manual/rewrite/rewrite_intro.xml @@ -100,7 +100,7 @@ well as write your own.

Example -.Matches any +.Matches any single characterc.t will match cat, cot, cut, etc. +Repeats the previous match one or more @@ -125,11 +125,14 @@ For more on backreferences see below. [ ]A character class - matches one of the charactersc[uoa]t matches cut, cot or cat. -!NotNegates a match - that is, -ensures that it does not match. - +[^ ]Negative character class - matches any character not specifiedc[^/]t matches cat or c=t but not c/t +

In mod_rewrite the ! character can be +used before a regular expression to negate it. This is, a string will +be considered to have matched only if it does not match the rest of +the expression.

+
Regex Back-Reference Availability -- 2.40.0