summaryrefslogtreecommitdiff
path: root/devdocs/elisp/rx-notation.html
diff options
context:
space:
mode:
authorCraig Jennings <c@cjennings.net>2025-08-14 22:58:58 -0500
committerCraig Jennings <c@cjennings.net>2025-08-14 22:58:58 -0500
commit82ba818ff456bcd6d56a06226e3f27e98fbb55c3 (patch)
tree158cfc17b2f644a10f063cb546752cfaae12c97f /devdocs/elisp/rx-notation.html
parent9278ddd4ea1a8b1a4c1edaa8894516e3f48d245b (diff)
downloaddotemacs-82ba818ff456bcd6d56a06226e3f27e98fbb55c3.tar.gz
dotemacs-82ba818ff456bcd6d56a06226e3f27e98fbb55c3.zip
removing all downloaded devdocs files
Diffstat (limited to 'devdocs/elisp/rx-notation.html')
-rw-r--r--devdocs/elisp/rx-notation.html36
1 files changed, 0 insertions, 36 deletions
diff --git a/devdocs/elisp/rx-notation.html b/devdocs/elisp/rx-notation.html
deleted file mode 100644
index 397812d2..00000000
--- a/devdocs/elisp/rx-notation.html
+++ /dev/null
@@ -1,36 +0,0 @@
- <h4 class="subsection">The rx Structured Regexp Notation</h4> <p>As an alternative to the string-based syntax, Emacs provides the structured <code>rx</code> notation based on Lisp S-expressions. This notation is usually easier to read, write and maintain than regexp strings, and can be indented and commented freely. It requires a conversion into string form since that is what regexp functions expect, but that conversion typically takes place during byte-compilation rather than when the Lisp code using the regexp is run. </p> <p>Here is an <code>rx</code> regexp<a id="DOCF22" href="#FOOT22"><sup>22</sup></a> that matches a block comment in the C programming language: </p> <div class="example"> <pre class="example">(rx "/*" ; Initial /*
- (zero-or-more
- (or (not (any "*")) ; Either non-*,
- (seq "*" ; or * followed by
- (not (any "/"))))) ; non-/
- (one-or-more "*") ; At least one star,
- "/") ; and the final /
-</pre>
-</div> <p>or, using shorter synonyms and written more compactly, </p> <div class="example"> <pre class="example">(rx "/*"
- (* (| (not "*")
- (: "*" (not "/"))))
- (+ "*") "/")
-</pre>
-</div> <p>In conventional string syntax, it would be written </p> <div class="example"> <pre class="example">"/\\*\\(?:[^*]\\|\\*[^/]\\)*\\*+/"
-</pre>
-</div> <p>The <code>rx</code> notation is mainly useful in Lisp code; it cannot be used in most interactive situations where a regexp is requested, such as when running <code>query-replace-regexp</code> or in variable customization. </p> <table class="menu" border="0" cellspacing="0"> <tr>
-<td align="left" valign="top">• <a href="rx-constructs" accesskey="1">Rx Constructs</a>
-</td>
-<td> </td>
-<td align="left" valign="top">Constructs valid in rx forms. </td>
-</tr> <tr>
-<td align="left" valign="top">• <a href="rx-functions" accesskey="2">Rx Functions</a>
-</td>
-<td> </td>
-<td align="left" valign="top">Functions and macros that use rx forms. </td>
-</tr> <tr>
-<td align="left" valign="top">• <a href="extending-rx" accesskey="3">Extending Rx</a>
-</td>
-<td> </td>
-<td align="left" valign="top">How to define your own rx forms. </td>
-</tr> </table><div class="_attribution">
- <p class="_attribution-p">
- Copyright &copy; 1990-1996, 1998-2022 Free Software Foundation, Inc. <br>Licensed under the GNU GPL license.<br>
- <a href="https://www.gnu.org/software/emacs/manual/html_node/elisp/Rx-Notation.html" class="_attribution-link">https://www.gnu.org/software/emacs/manual/html_node/elisp/Rx-Notation.html</a>
- </p>
-</div>