From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: npostavs@gmail.com Newsgroups: gmane.emacs.bugs Subject: bug#36167: [PATCH] Replace manually crafted hex regexes with [[:xdigit:]] Date: Tue, 11 Jun 2019 13:50:49 -0400 Message-ID: <85zhmo9fk6.fsf@gmail.com> References: <1560263874.21373.1@yandex.ru> <5f7ea771-2a22-ba10-b3ce-6adb5e85dc9d@cs.ucla.edu> <85476B58-4CBD-45C9-903C-5E49D8E5D019@acm.org> <83zhmo834p.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=gb2312 Content-Transfer-Encoding: quoted-printable Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="10481"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1.92 (windows-nt) Cc: mattiase@acm.org, eggert@cs.ucla.edu, 36167@debbugs.gnu.org, hi-angel@yandex.ru To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Jun 11 19:52:19 2019 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1hakwV-0002bJ-6j for geb-bug-gnu-emacs@m.gmane.org; Tue, 11 Jun 2019 19:52:19 +0200 Original-Received: from localhost ([::1]:33466 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hakwS-0007KX-0A for geb-bug-gnu-emacs@m.gmane.org; Tue, 11 Jun 2019 13:52:17 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:39122) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hakvH-0007FA-16 for bug-gnu-emacs@gnu.org; Tue, 11 Jun 2019 13:51:04 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hakvG-00060A-20 for bug-gnu-emacs@gnu.org; Tue, 11 Jun 2019 13:51:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:46606) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hakvF-000602-VB for bug-gnu-emacs@gnu.org; Tue, 11 Jun 2019 13:51:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1hakvF-0002j7-SI for bug-gnu-emacs@gnu.org; Tue, 11 Jun 2019 13:51:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: npostavs@gmail.com Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 11 Jun 2019 17:51:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 36167 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 36167-submit@debbugs.gnu.org id=B36167.156027545810472 (code B ref 36167); Tue, 11 Jun 2019 17:51:01 +0000 Original-Received: (at 36167) by debbugs.gnu.org; 11 Jun 2019 17:50:58 +0000 Original-Received: from localhost ([127.0.0.1]:60150 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hakvC-0002iq-8r for submit@debbugs.gnu.org; Tue, 11 Jun 2019 13:50:58 -0400 Original-Received: from mail-io1-f50.google.com ([209.85.166.50]:37862) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hakvA-0002id-4v for 36167@debbugs.gnu.org; Tue, 11 Jun 2019 13:50:56 -0400 Original-Received: by mail-io1-f50.google.com with SMTP id e5so10653402iok.4 for <36167@debbugs.gnu.org>; Tue, 11 Jun 2019 10:50:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-transfer-encoding; bh=hdSECgdfh6U1KP8fcrv7Kx/KK6B7W1Dc+5P2OIs3sVI=; b=EaKrAWcWzmihzG7ZcFndDvSOs4Ju/XBJffZUtSAZQ5+3zA8pd6OQv8ISU/r5AKwe+l ZfTyYgucuiHBauFYmLb2JdmPJLw/mYh5VyWMOwo8dEfa/89KF1LyJFs+hsI92GWsIVjS r38M1nacTAsyLG68gRaDW2+LnKaFN4KtKqrwDh4aTpgOieyqLri6WlOXocJeLTdCTzbm Qsj48bL9RalLbYjQboYckV56p+rpvh1daBgl2t7ezk49yQWA3U2KZoo77ASXnyH73i7w RdxfN+Ls7CSg82iicTESMhexpgNi42WYjagI5bBzL5erfEJE4ZF1JPd2CivCx7/LrRMl wkQQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version:content-transfer-encoding; bh=hdSECgdfh6U1KP8fcrv7Kx/KK6B7W1Dc+5P2OIs3sVI=; b=eHaQw137FwbBsi5wYEiNggZIynzG+CkeQkiriYCl5HB0dt0fSN8V2iWPiIlkFGvh4F S5wFaMOaJkIbf8iLEOf1tt4R1KQm1TG/hoSwGMNMtE1WhMZ6qgbMJq6YTEPeU1sb1S1G zCIa6Jlx5S+EU972T7SRlF6+sefzIrLfPXFiR4kTqKPBDoS40/2g/NB2tY021QB85st8 dhG/rz4fzihDhhwkfS56ieloyRzznRuv37XaNq+Lzg3qOC9oGPf6WhxllS33mIIS7Ub+ Qg1SgVcRsnv8eh1dIX1MLgH6GLsCDh0R1EgidqHs/AiVVNOPHr2qM0dZHziPw+hCfDue BQqA== X-Gm-Message-State: APjAAAVI/FEIeSbD0WlZ2ifjKhzI6S1c8YvVb0WbuUZk40HQfSiAZKCP DNSnFA/4unHufWPNjDrSKqY= X-Google-Smtp-Source: APXvYqzYrJTrmdFLM1oWHLCPtFlHEQOjd2F1cMCOlOfyq1zhwTFRqQXmKnRsribg2F4etpxxfAsgJg== X-Received: by 2002:a5e:8f42:: with SMTP id x2mr32011103iop.35.1560275450494; Tue, 11 Jun 2019 10:50:50 -0700 (PDT) Original-Received: from vhost2 (CPE001143542e1f-CMf81d0f809fa0.cpe.net.cable.rogers.com. [99.230.51.196]) by smtp.gmail.com with ESMTPSA id x22sm4780162ioh.87.2019.06.11.10.50.49 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 11 Jun 2019 10:50:49 -0700 (PDT) In-Reply-To: <83zhmo834p.fsf@gnu.org> (Eli Zaretskii's message of "Tue, 11 Jun 2019 20:04:38 +0300") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:160395 Archived-At: Eli Zaretskii writes: >> > [0-9A-Fa-f] still has one advantage: the reader, and the >> > writer, know exactly which characters are included without looking it = up. ^^^^^^^^^^^^^^^^^^^= ^^ >> > - whether non-ascii digits are accepted > =A1=AE[:digit:]=A1=AF > This matches =A1=AE0=A1=AF through =A1=AE9=A1=AF. Thus, =A1=AE[-+[= :digit:]]=A1=AF matches any > digit, as well as =A1=AE+=A1=AF and =A1=AE-=A1=AF. > Is anything missing here? Where did the question about non-ASCII > digits come from, given this text? It came from (a hypothetical) user who doesn't remember (or hasn't read) the documentation. The advantage of [0-9A-Fa-f] vs [[:xdigit:]] here is similar to explicit comparison against (point-min) vs (bobp) that you pointed out in #35967.