emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

emacs-27 2aed279: Warn about the likes of "[:alnum:]" in regexps


From: Eli Zaretskii
Subject: emacs-27 2aed279: Warn about the likes of "[:alnum:]" in regexps
Date: Sat, 22 Feb 2020 04:09:08 -0500 (EST)

branch: emacs-27
commit 2aed279be18ddd1e2c2b6a8102b94127fe41906c
Author: Eli Zaretskii <address@hidden>
Commit: Eli Zaretskii <address@hidden>

    Warn about the likes of "[:alnum:]" in regexps
    
    * doc/lispref/searching.texi (Char Classes): Warn about erroneous
    usage of named character classes.  Suggested by Stephen Leake
    <address@hidden>.
---
 doc/lispref/searching.texi | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/doc/lispref/searching.texi b/doc/lispref/searching.texi
index 1f6db06..a4d5a27 100644
--- a/doc/lispref/searching.texi
+++ b/doc/lispref/searching.texi
@@ -582,8 +582,13 @@ an unquoted @samp{[} is special again and a @samp{]} not.
 @cindex alpha character class, regexp
 @cindex xdigit character class, regexp
 
-  Here is a table of the classes you can use in a character alternative,
-and what they mean:
+  Below is a table of the classes you can use in a character
+alternative, and what they mean.  Note that the @samp{[} and @samp{]}
+characters that enclose the class name are part of the name, so a
+regular expression using these classes needs one more pair of
+brackets.  For example, a regular expression matching a sequence of
+one or more letters and digits would be @samp{[[:alnum:]]+}, not
+@samp{[:alnum:]+}.
 
 @table @samp
 @item [:ascii:]



reply via email to

[Prev in Thread] Current Thread [Next in Thread]