[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
- :alnum: broken?, Stephen Leake, 2020/02/21
- Re: :alnum: broken?, Paul Eggert, 2020/02/21
- Re: :alnum: broken?, Mattias Engdegård, 2020/02/23
- Re: :alnum: broken?, Paul Eggert, 2020/02/23
- Re: :alnum: broken?, Eli Zaretskii, 2020/02/23
- Re: :alnum: broken?, Óscar Fuentes, 2020/02/23
- RE: :alnum: broken?, Drew Adams, 2020/02/23
- Re: :alnum: broken?, Richard Stallman, 2020/02/24