(tomcat) branch 10.1.x updated: Improve RewriteRule syntax reference (#1044)

[email protected]
Newsgroups gmane.comp.jakarta.tomcat.devel
Message-ID <178704334865.1175424.12703474161893775293@gitbox3-he-fi.apache.org>
This is an automated email from the ASF dual-hosted git repository.

markt-asf pushed a commit to branch 10.1.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git


The following commit(s) were added to refs/heads/10.1.x by this push:
     new 2ba0dd396b Improve RewriteRule syntax reference (#1044)
2ba0dd396b is described below

commit 2ba0dd396bcae9643d463af4cc464371293a9b64
Author: sainadh777 <[email protected]>
AuthorDate: Tue Aug 18 01:47:21 2026 -0700

    Improve RewriteRule syntax reference (#1044)
    
    * Use a table for RewriteRule syntax
---
 webapps/docs/changelog.xml |  4 ++++
 webapps/docs/rewrite.xml   | 59 +++++++++++++++++++++++++---------------------
 2 files changed, 36 insertions(+), 27 deletions(-)

diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index b22186c697..70b23617db 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -145,6 +145,10 @@
         Manager: Fix a potential concurrency issue when ordering sessions prior
         to displaying a list of session. (markt)
       </fix>
+      <docs>
+        Wrap the <code>RewriteRule</code> regular expression syntax reference
+        on narrow displays. Pull request <pr>1044</pr> by sainadh777. (markt)
+      </docs>
     </changelog>
   </subsection>
 </section>
diff --git a/webapps/docs/rewrite.xml b/webapps/docs/rewrite.xml
index 5c29e37c44..3ba98b8716 100644
--- a/webapps/docs/rewrite.xml
+++ b/webapps/docs/rewrite.xml
@@ -527,33 +527,38 @@ RewriteRule ^/(.*)$ ${uc:$1}
       <p>Some hints on the syntax of regular
       expressions:</p>
 
-<!-- TODO: Why is the following pre-formatted non-wrappable text? -->
-<pre>
-<strong>Text:</strong>
-  <strong><code>.</code></strong>           Any single character
-  <strong><code>[</code></strong>chars<strong><code>]</code></strong>     Character class: Any character of the class 'chars'
-  <strong><code>[^</code></strong>chars<strong><code>]</code></strong>    Character class: Not a character of the class 'chars'
-  text1<strong><code>|</code></strong>text2 Alternative: text1 or text2
-
-<strong>Quantifiers:</strong>
-  <strong><code>?</code></strong>           0 or 1 occurrences of the preceding text
-  <strong><code>*</code></strong>           0 or N occurrences of the preceding text (N &gt; 0)
-  <strong><code>+</code></strong>           1 or N occurrences of the preceding text (N &gt; 1)
-
-<strong>Grouping:</strong>
-  <strong><code>(</code></strong>text<strong><code>)</code></strong>      Grouping of text
-              (used either to set the borders of an alternative as above, or
-              to make backreferences, where the <strong>N</strong>th group can
-              be referred to on the RHS of a RewriteRule as <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 the given char
-              (for instance, to specify the chars "<code>.[]()</code>" <em>etc.</em>)
-</pre>
+      <table class="defaultTable">
+        <tr><th colspan="2">Text</th></tr>
+        <tr><td><code>.</code></td>
+          <td>Any single character</td></tr>
+        <tr><td><code>[chars]</code></td>
+          <td>Character class: Any character of the class 'chars'</td></tr>
+        <tr><td><code>[^chars]</code></td>
+          <td>Character class: Not a character of the class 'chars'</td></tr>
+        <tr><td><code>text1|text2</code></td>
+          <td>Alternative: text1 or text2</td></tr>
+        <tr><th colspan="2">Quantifiers</th></tr>
+        <tr><td><code>?</code></td>
+          <td>0 or 1 occurrences of the preceding text</td></tr>
+        <tr><td><code>*</code></td>
+          <td>0 or N occurrences of the preceding text (N &gt; 0)</td></tr>
+        <tr><td><code>+</code></td>
+          <td>1 or N occurrences of the preceding text (N &gt; 1)</td></tr>
+        <tr><th colspan="2">Grouping</th></tr>
+        <tr><td><code>(text)</code></td>
+          <td>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)</td></tr>
+        <tr><th colspan="2">Anchors</th></tr>
+        <tr><td><code>^</code></td>
+          <td>Start-of-line anchor</td></tr>
+        <tr><td><code>$</code></td>
+          <td>End-of-line anchor</td></tr>
+        <tr><th colspan="2">Escaping</th></tr>
+        <tr><td><code>\char</code></td>
+          <td>Escape the given char (for instance, to specify the chars
+            ".[]()" <em>etc.</em>)</td></tr>
+      </table>
 
       <p>For more information about regular expressions, have a look at the
       perl regular expression manpage ("<a
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.