From: Mattias EngdegÄrd Date: Sat, 17 May 2025 09:12:31 +0000 (+0200) Subject: * doc/lispref/searching.texi (Rx Notation): Fix example (bug#76731) X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=de720af152a457b44db26e4d6b17dab2d4622b19;p=emacs.git * doc/lispref/searching.texi (Rx Notation): Fix example (bug#76731) The example purporting to match C comments was wrong. Reported by Yue Yi, whose proposed remedy is used here. (cherry picked from commit 2606e3dd994d2d75850630707c00c0156afced9a) --- diff --git a/doc/lispref/searching.texi b/doc/lispref/searching.texi index 7840fe77e60..9e498b56bb4 100644 --- a/doc/lispref/searching.texi +++ b/doc/lispref/searching.texi @@ -1030,13 +1030,13 @@ programming language: @example @group -(rx "/*" ; Initial /* +(rx "/*" ; Initial /* (zero-or-more - (or (not "*") ; Either non-*, - (seq "*" ; or * followed by - (not "/")))) ; non-/ - (one-or-more "*") ; At least one star, - "/") ; and the final / + (or (not "*") ; Either non-*, + (seq (one-or-more "*") ; or some * followed by + (not (or "*" "/"))))) ; neither * nor / + (one-or-more "*") ; At least one star, + "/") ; and the final / @end group @end example @@ -1047,7 +1047,7 @@ or, using shorter synonyms and written more compactly, @group (rx "/*" (* (| (not "*") - (: "*" (not "/")))) + (: (+ "*") (not (in "*/"))))) (+ "*") "/") @end group @end example @@ -1056,7 +1056,7 @@ or, using shorter synonyms and written more compactly, In conventional string syntax, it would be written @example -"/\\*\\(?:[^*]\\|\\*[^/]\\)*\\*+/" +"/\\*\\(?:[^*]\\|\\*+[^*/]\\)*\\*+/" @end example The @code{rx} notation is mainly useful in Lisp code; it cannot be