From: Christophe Jaillet Date: Sun, 1 Sep 2019 09:15:45 +0000 (+0000) Subject: Fix PR 63713 reported by WJCarpenter: X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=6ee55a48404027906338ff5b3f4ca0cd46129824;p=apache Fix PR 63713 reported by WJCarpenter: Add a small word about '\' which is used in the examples below. Add some missing links (, ) Improve some xml layout to have it readable. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1866233 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/docs/manual/rewrite/intro.xml b/docs/manual/rewrite/intro.xml index 52cdb3dcc9..d0897fdc0d 100644 --- a/docs/manual/rewrite/intro.xml +++ b/docs/manual/rewrite/intro.xml @@ -73,7 +73,7 @@ it will tell you exactly how each rule is processed.

Regular Expressions -

mod_rewrite uses the Perl Compatible +

mod_rewrite uses the Perl Compatible Regular Expression vocabulary. In this document, we do not attempt to provide a detailed reference to regular expressions. For that, we recommend the PCRE man pages, the @@ -103,32 +103,65 @@ well as write your own.

Example -.Matches any single -characterc.t will match cat, -cot, cut, etc. -+Repeats the previous match one or more -timesa+ matches a, aa, -aaa, etc -*Repeats the previous match zero or more -times.a* matches all the same things -a+ matches, but will also match an empty string. -?Makes the match optional. -colou?r will match color and colour. + + . + Matches any single character + c.t will match cat, cot, + cut, etc + + + + + Repeats the previous match one or more times + a+ matches a, aa, + aaa, etc + + + * + Repeats the previous match zero or more times + a* matches all the same things a+ matches, + but will also match an empty string + + + ? + Makes the match optional + colou?r will match color and + colour + + + \ + Escape the next character + \. will match . (dot) and not any single + character as explain above -^Called an anchor, matches the beginning -of the string^a matches a string that begins with -a -$The other anchor, this matches the end of -the string.a$ matches a string that ends with -a. -( )Groups several characters into a single -unit, and captures a match for use in a backreference.(ab)+ -matches ababab - that is, the + applies to the group. -For more on backreferences see below. -[ ]A character class - matches one of the -charactersc[uoa]t matches cut, -cot or cat. -[^ ]Negative character class - matches any character not specifiedc[^/]t matches cat or c=t but not c/t + + ^ + Called an anchor, matches the beginning of the string + ^a matches a string that begins with a + + + $ + The other anchor, this matches the end of the string + a$ matches a string that ends with a + + + ( ) + Groups several characters into a single unit, and captures a match + for use in a backreference + (ab)+ matches ababab - that is, the + + applies to the group. For more on backreferences see + below + + + [ ] + A character class - matches one of the characters + c[uoa]t matches cut, cot or + cat + + + [^ ] + Negative character class - matches any character not specified + c[^/]t matches cat or c=t but + not c/t

In mod_rewrite the ! character can be