* 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.
This commit is contained in:
Mattias Engdegård 2025-05-17 11:12:31 +02:00
parent e888bd990d
commit 2606e3dd99

View file

@ -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