From de720af152a457b44db26e4d6b17dab2d4622b19 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Mattias=20Engdeg=C3=A5rd?= Date: Sat, 17 May 2025 11:12:31 +0200 Subject: [PATCH] * 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) --- doc/lispref/searching.texi | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) 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 -- 2.39.5