httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cove...@apache.org
Subject svn commit: r1053212 - in /httpd/httpd/trunk/docs/manual/mod: mod_substitute.html.en mod_substitute.xml
Date Mon, 27 Dec 2010 22:41:01 GMT
Author: covener
Date: Mon Dec 27 22:41:00 2010
New Revision: 1053212

URL: http://svn.apache.org/viewvc?rev=1053212&view=rev
Log:
provide a mod_substitute example that uses backreferences
for matching as well as for substitution.


Modified:
    httpd/httpd/trunk/docs/manual/mod/mod_substitute.html.en
    httpd/httpd/trunk/docs/manual/mod/mod_substitute.xml

Modified: httpd/httpd/trunk/docs/manual/mod/mod_substitute.html.en
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/docs/manual/mod/mod_substitute.html.en?rev=1053212&r1=1053211&r2=1053212&view=diff
==============================================================================
--- httpd/httpd/trunk/docs/manual/mod/mod_substitute.html.en (original)
+++ httpd/httpd/trunk/docs/manual/mod/mod_substitute.html.en Mon Dec 27 22:41:00 2010
@@ -97,6 +97,18 @@
         </Location>
     </code></p></div>
 
+    <p>Backreferences can be used in the comparison and in the substituion,
+    when regular expressions are used, as illustrated in the following example: </p>
+    <div class="example"><h3>Example of using backreferences and captures</h3><p><code>
+        &lt;Location /&gt;
+        <span class="indent">
+            AddOutputFilterByType SUBSTITUTE text/html<br />
+            # "foo=k,bar=k" -&gt; "foo/bar=k" <br />
+            Substitute "s|foo=(\w+),bar=\1|foo/bar=$1"
+        </span>
+        &lt;/Location&gt;
+    </code></p></div>
+
     <p>A common use scenario for <code>mod_substitute</code> is the
     situation in which a front-end server proxies requests to a back-end
     server which returns HTML with hard-coded embedded URLs that refer

Modified: httpd/httpd/trunk/docs/manual/mod/mod_substitute.xml
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/docs/manual/mod/mod_substitute.xml?rev=1053212&r1=1053211&r2=1053212&view=diff
==============================================================================
--- httpd/httpd/trunk/docs/manual/mod/mod_substitute.xml (original)
+++ httpd/httpd/trunk/docs/manual/mod/mod_substitute.xml Mon Dec 27 22:41:00 2010
@@ -91,6 +91,18 @@
         &lt;/Location&gt;
     </example>
 
+    <p>Backreferences can be used in the comparison and in the substituion,
+    when regular expressions are used, as illustrated in the following example: </p>
+    <example><title>Example of using backreferences and captures</title>
+        &lt;Location /&gt;
+        <indent>
+            AddOutputFilterByType SUBSTITUTE text/html<br />
+            # "foo=k,bar=k" -> "foo/bar=k" <br />
+            Substitute "s|foo=(\w+),bar=\1|foo/bar=$1"
+        </indent>
+        &lt;/Location&gt;
+    </example>
+
     <p>A common use scenario for <code>mod_substitute</code> is the
     situation in which a front-end server proxies requests to a back-end
     server which returns HTML with hard-coded embedded URLs that refer



Mime
View raw message