From: Rich Bowen Date: Tue, 31 Jan 2006 01:50:52 +0000 (+0000) Subject: A few more terms added to the regex vocabulary lesson. X-Git-Tag: 2.2.1~107 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7714a251a6de367d7a8641eed994628bab7082cf;p=thirdparty%2Fapache%2Fhttpd.git A few more terms added to the regex vocabulary lesson. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.2.x@373664 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/docs/manual/rewrite/rewrite_intro.html.en b/docs/manual/rewrite/rewrite_intro.html.en index 60ed27cc4d3..1d1624791ed 100644 --- a/docs/manual/rewrite/rewrite_intro.html.en +++ b/docs/manual/rewrite/rewrite_intro.html.en @@ -73,15 +73,46 @@ formulae, rather than magical incantations.

Regex vocabulary

The following are the minimal building blocks you will need, in order -to write regular expressions and RewriteRules.

+to write regular expressions and RewriteRules. They certainly do not +represent a complete regular expression vocabulary, but they are a good +place to start, and should help you read basic regular expressions, as +well as write your own.

+ - + + + + + + + + + +
Character MeaningExample
.Matches any character
.Matches any +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.
.Matches any +charactercolou?r will match color and +colour.
^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.
!NotNegates a match - that is, +ensures that it does not match.
diff --git a/docs/manual/rewrite/rewrite_intro.xml b/docs/manual/rewrite/rewrite_intro.xml index 3336169bdea..1a66c8dd21c 100644 --- a/docs/manual/rewrite/rewrite_intro.xml +++ b/docs/manual/rewrite/rewrite_intro.xml @@ -75,15 +75,46 @@ formulae, rather than magical incantations.

The following are the minimal building blocks you will need, in order to write regular expressions and RewriteRules.

+module="mod_rewrite">RewriteRules. They certainly do not +represent a complete regular expression vocabulary, but they are a good +place to start, and should help you read basic regular expressions, as +well as write your own.

+ - + + + + + + + + + +
Character MeaningExample
.Matches any character
.Matches any +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.
.Matches any +charactercolou?r will match color and +colour.
^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.
!NotNegates a match - that is, +ensures that it does not match.