From 18f6e0c85a7313d221da868e6bf55af32828112b Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Mon, 19 Jun 2023 13:35:48 -0700 Subject: [PATCH] Document proposed regex fix (bug#64128) * doc/lispref/searching.texi (Regexp Special): Say that repetition operators are not special after \`, and that they work as expected after other backslash escapes. --- doc/lispref/searching.texi | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/doc/lispref/searching.texi b/doc/lispref/searching.texi index 28230cea64..7c9893054d 100644 --- a/doc/lispref/searching.texi +++ b/doc/lispref/searching.texi @@ -546,15 +546,11 @@ Regexp Special For historical compatibility, a repetition operator is treated as ordinary if it appears at the start of a regular expression -or after @samp{^}, @samp{\(}, @samp{\(?:} or @samp{\|}. +or after @samp{^}, @samp{\`}, @samp{\(}, @samp{\(?:} or @samp{\|}. For example, @samp{*foo} is treated as @samp{\*foo}, and @samp{two\|^\@{2\@}} is treated as @samp{two\|^@{2@}}. It is poor practice to depend on this behavior; use proper backslash escaping anyway, regardless of where the repetition operator appears. -Also, a repetition operator should not immediately follow a backslash escape -that matches only empty strings, as Emacs has bugs in this area. -For example, it is unwise to use @samp{\b*}, which can be omitted -without changing the documented meaning of the regular expression. As a @samp{\} is not special inside a bracket expression, it can never remove the special meaning of @samp{-}, @samp{^} or @samp{]}. -- 2.39.2