GNU bug report logs - #10649
23.4; Regexp char classes not working

Previous Next

Package: emacs;

Reported by: Raffaele Ricciardi <rfflrccrd <at> gmail.com>

Date: Mon, 30 Jan 2012 05:16:02 UTC

Severity: normal

Tags: notabug

Found in version 23.4

Done: Glenn Morris <rgm <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


Message #8 received at 10649 <at> debbugs.gnu.org (full text, mbox):

From: Glenn Morris <rgm <at> gnu.org>
To: Raffaele Ricciardi <rfflrccrd <at> gmail.com>
Cc: 10649 <at> debbugs.gnu.org
Subject: Re: bug#10649: 23.4; Regexp char classes not working
Date: Mon, 30 Jan 2012 03:06:43 -0500
Raffaele Ricciardi wrote:

> - start emacs -Q
> - evaluate this forms:
> (string-match "[:xdigit:]" "0")
> (string-match "[:xdigit:]" "a")
> (string-match "[:alnum:]" "5")
> They should return non-nil, but they return nil instead.

From the elisp manual:

34.3.1.2 Character Classes

Here is a table of the classes you can use in a character alternative,
                                            ^^^^^^^^^^^^^^^^^^^^^^^^^

34.3.1.1 Special Characters in Regular Expressions
[...]
`[ ... ]'
     is a "character alternative", which begins with `[' and is
     terminated by `]'

Therefore you must write eg

  (string-match "[[:xdigit:]]" "0")




This bug report was last modified 13 years and 109 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.