emacs-devel
[Top][All Lists]
Advanced

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

Re: :alnum: broken?


From: Stephen Leake
Subject: Re: :alnum: broken?
Date: Fri, 21 Feb 2020 13:28:19 -0800
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/26.2 (windows-nt)

Paul Eggert <address@hidden> writes:

> On 2/21/20 10:58 AM, Stephen Leake wrote:
>>    (string-match "[:alnum:]+" text)
>
> You meant "[[:alnum:]]+".

Ah, that makes sense.

I propose this patch to help others avoid the same mistake:

--- a/doc/lispref/searching.texi
+++ b/doc/lispref/searching.texi
@@ -582,8 +582,10 @@ Char Classes
 @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:
+  Here is a table of the classes you can use in a character
+alternative, and what they mean. Note that the characters @samp{[]}
+are part of the character class name, so a regular expression using
+one would be @samp{[[:alnum:]]+}.
 
 @table @samp
 @item [:ascii:]

-- 
-- Stephe



reply via email to

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