GNU bug report logs - #36167
[PATCH] Replace manually crafted hex regexes with [[:xdigit:]]

Previous Next

Package: emacs;

Reported by: Konstantin Kharlamov <hi-angel <at> yandex.ru>

Date: Tue, 11 Jun 2019 12:00:02 UTC

Severity: wishlist

Tags: patch

Done: Eli Zaretskii <eliz <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Paul Eggert <eggert <at> cs.ucla.edu>
To: Eli Zaretskii <eliz <at> gnu.org>, Drew Adams <drew.adams <at> oracle.com>
Cc: mattiase <at> acm.org, 36167 <at> debbugs.gnu.org, hi-angel <at> yandex.ru
Subject: bug#36167: [PATCH] Replace manually crafted hex regexes with [[:xdigit:]]
Date: Tue, 11 Jun 2019 10:18:44 -0700
On 6/11/19 10:04 AM, Eli Zaretskii wrote:
> Where did the question about non-ASCII
> digits come from, given this text?

It came from POSIX, where [:xdigit:] and [:digit:] might match other 
characters. Similarly, in POSIX [a-f] might match characters other than 
'a', 'b', 'c', 'd', 'e', 'f'. We don't need to worry about this in 
Emacs, since Emacs regexps don't have that particular misfeature of POSIX.

I'm on the fence about replacing 0-9A-Fa-f with [:xdigit:], as I can see 
both sides of the argument. If Mattias is dubious, then perhaps we 
should leave the regexps alone - he's had more experience than the rest 
of us when it comes to scanning for dubious regexp constructions.





This bug report was last modified 5 years and 321 days ago.

Previous Next


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