The <CODE>RewriteRule</CODE> directive is the real rewriting workhorse. The
@@ -1164,31 +1308,56 @@ Some hints about the syntax of regular expressions:
<TR>
<TDVALIGN=TOP>
<PRE>
<STRONG><CODE>^</CODE></STRONG> Start of line
<STRONG><CODE>$</CODE></STRONG> End of line
<STRONG>Text:</STRONG>
<STRONG><CODE>.</CODE></STRONG> Any single character
<STRONG><CODE>[</CODE></STRONG>chars<STRONG><CODE>]</CODE></STRONG> One of chars
<STRONG><CODE>[^</CODE></STRONG>chars<STRONG><CODE>]</CODE></STRONG> None of chars
<STRONG><CODE>?</CODE></STRONG> 0 or 1 of the preceding char
<STRONG><CODE>*</CODE></STRONG> 0 or N of the preceding char
<STRONG><CODE>+</CODE></STRONG> 1 or N of the preceding char
<STRONG><CODE>\</CODE></STRONG>char escape that specific char
(e.g. for specifying the chars "<CODE>.[]()</CODE>" etc.)
<STRONG><CODE>(</CODE></STRONG>string<STRONG><CODE>)</CODE></STRONG> Grouping of chars (the <STRONG>N</STRONG>th group can be used on the RHS with <CODE>$</CODE><STRONG>N</STRONG>)
<STRONG><CODE>[</CODE></STRONG>chars<STRONG><CODE>]</CODE></STRONG> Character class: One of chars
<STRONG><CODE>[^</CODE></STRONG>chars<STRONG><CODE>]</CODE></STRONG> Character class: None of chars
text1<STRONG><CODE>|</CODE></STRONG>text2 Alternative: text1 or text2
<STRONG>Quantifiers:</STRONG>
<STRONG><CODE>?</CODE></STRONG> 0 or 1 of the preceding text
<STRONG><CODE>*</CODE></STRONG> 0 or N of the preceding text (N > 1)
<STRONG><CODE>+</CODE></STRONG> 1 or N of the preceding text (N > 1)
<STRONG>Grouping:</STRONG>
<STRONG><CODE>(</CODE></STRONG>text<STRONG><CODE>)</CODE></STRONG> Grouping of text
(either to set the borders of an alternative or
for making backreferences where the <STRONG>N</STRONG>th group can
be used on the RHS of a RewriteRule with <CODE>$</CODE><STRONG>N</STRONG>)
<STRONG>Anchors:</STRONG>
<STRONG><CODE>^</CODE></STRONG> Start of line anchor
<STRONG><CODE>$</CODE></STRONG> End of line anchor
<STRONG>Escaping:</STRONG>
<STRONG><CODE>\</CODE></STRONG>char escape that particular char
(for instance to specify the chars "<CODE>.[]()</CODE>" etc.)
</PRE>
</TD>
</TR>
</TABLE>
<P>
Additionally the NOT character ('<CODE>!</CODE>') is a possible pattern
prefix. This gives you the ability to negate a pattern; to say, for instance: ``<EM>if
the current URL does <STRONG>NOT</STRONG> match to this pattern</EM>''. This can be used
for special cases where it is better to match the negative pattern or as a
last default rule.
For more information about regular expressions either have a look at your
local regex(3) manpage or its <CODE>src/regex/regex.3</CODE> copy in the
Apache 1.3 distribution. When you are interested in more detailed and deeper
information about regular expressions and its variants (POSIX regex, Perl
regex, etc.) have a look at the following dedicated book on this topic:
<BLOCKQUOTE>
<EM>Mastering Regular Expressions</EM><BR>
Jeffrey E.F. Friedl<BR>
Nutshell Handbook Series<BR>
O'Reilly & Associates, Inc. 1997<BR>
ISBN 1-56592-257-3<BR>
</BLOCKQUOTE>
<P>
Additionally in mod_rewrite the NOT character ('<CODE>!</CODE>') is a possible
pattern prefix. This gives you the ability to negate a pattern; to say, for
instance: ``<EM>if the current URL does <STRONG>NOT</STRONG> match to this
pattern</EM>''. This can be used for special cases where it is better to match