From unknown Thu Jun 19 12:36:55 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#25336 <25336@debbugs.gnu.org> To: bug#25336 <25336@debbugs.gnu.org> Subject: Status: Reply-To: bug#25336 <25336@debbugs.gnu.org> Date: Thu, 19 Jun 2025 19:36:55 +0000 reassign 25336 grep submitter 25336 Zepp Lu severity 25336 normal thanks From debbugs-submit-bounces@debbugs.gnu.org Mon Jan 02 12:31:48 2017 Received: (at submit) by debbugs.gnu.org; 2 Jan 2017 17:31:48 +0000 Received: from localhost ([127.0.0.1]:39592 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cO6Sa-0002Yu-0s for submit@debbugs.gnu.org; Mon, 02 Jan 2017 12:31:48 -0500 Received: from eggs.gnu.org ([208.118.235.92]:54966) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cO2a0-00059d-A7 for submit@debbugs.gnu.org; Mon, 02 Jan 2017 08:23:12 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cO2Zt-0005fz-Fu for submit@debbugs.gnu.org; Mon, 02 Jan 2017 08:23:06 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: * X-Spam-Status: No, score=1.1 required=5.0 tests=BAYES_50, FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FROM,HTML_MESSAGE,T_DKIM_INVALID autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:54886) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1cO2Zt-0005fs-CC for submit@debbugs.gnu.org; Mon, 02 Jan 2017 08:23:05 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:45932) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cO2Zs-0001tT-68 for bug-grep@gnu.org; Mon, 02 Jan 2017 08:23:05 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cO2Zr-0005f9-5t for bug-grep@gnu.org; Mon, 02 Jan 2017 08:23:04 -0500 Received: from mail-wm0-x236.google.com ([2a00:1450:400c:c09::236]:36801) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cO2Zq-0005eW-Up for bug-grep@gnu.org; Mon, 02 Jan 2017 08:23:03 -0500 Received: by mail-wm0-x236.google.com with SMTP id c85so180233404wmi.1 for ; Mon, 02 Jan 2017 05:23:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=0F+C4BlKlnHcjAr7OMhFtWEBonx4vfsvn9KvGcBgt54=; b=Ix9Q7f1xT3fgCzjQME2VW2GMTB3+hDBRA5GwHgjcOm2GNPaRxeZO1T230W+hMpjUnZ gpFPJJeOFAH1bwlJYvNSz0XPDea8Or936Umh6mvFlbTEZGyvv7sdYIkzChVDbNNt56Y+ 1le+s7ih3hB1pVfwRItuBWQpTiEvi1wZzj7e8fS+f+JIrFEYeVk3T9x8ZPFs1pd2vfCb K6PSrIovNoeZL2HwEMpSFNs9I8VWk+2ceWOxCcxETj61fHOyDDU1YLmL+nGRe8/cPTnt voVl1KX/u4ojt2B9XHVVloG7RXqBWZcYS7KY0o4dB1LL0Wu2iZ++7kAkhtdo1s8bP2l4 9PCw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=0F+C4BlKlnHcjAr7OMhFtWEBonx4vfsvn9KvGcBgt54=; b=aCoHZg3f0gjBXk4wV4DLkQKdiefO61REHVsi3/JurBHS4/SHz4BEK9LkR+z/p6aZ9i PocSCLk1YAG2h1sSgxBaZS/WPcqiXCSPVO34IBDatmwG02PAeEWJMQvS+UXC/WZCxmY9 9GbPBrmNYEyN605bhmx385/NRxnplkU5/pxXvulnah2FpWVDzHREvG9z0nheFZrtjgLR L15pxCZXFuHq0iT1hwZgT2Q8EAR2Dp3S2H0eqvhQyTDKKQ0jXH1jKFCPfyYAySsrR3ET wjf9i7pV63DB5sCxg1Q/02Dgr2LKjvmfC2RcleImvSZXxFKvCsYV0USJO9cJohQ/Yt+Z qBeg== X-Gm-Message-State: AIkVDXIbFliSrYgHRCcEC+j7HB5KiVV8lsmXoCvsEEXZPP++G6vi30MgKj99+rJipZMDLxRm0wERb1WBtbckMw== X-Received: by 10.28.218.129 with SMTP id r123mr48928447wmg.137.1483363380221; Mon, 02 Jan 2017 05:23:00 -0800 (PST) MIME-Version: 1.0 Received: by 10.28.67.66 with HTTP; Mon, 2 Jan 2017 05:22:59 -0800 (PST) From: Zepp Lu Date: Mon, 2 Jan 2017 21:22:59 +0800 Message-ID: Subject: To: bug-grep@gnu.org Content-Type: multipart/alternative; boundary=001a114697bc59de1d05451c730b X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -1.8 (-) X-Debbugs-Envelope-To: submit X-Mailman-Approved-At: Mon, 02 Jan 2017 12:31:47 -0500 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.8 (-) --001a114697bc59de1d05451c730b Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable OS: Archlinux grep version: 2.27-1 Bug description: grep behaves weirdly when searching hex values. How to reproduce: $ printf '\x53\xef' | grep -aoP '\x53\xef' (no output, returns 1) $ printf '\x53\xc3\xaf' | grep -aoP '\x53\xef' S=C3=AF $ printf '\x53\xc3\xef' | grep -aoP '\x53\xef' (no output, returns 1) grep (version 2.12-2) provided by Debian works just fine. --001a114697bc59de1d05451c730b Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
OS: Archlin= ux
grep version: = 2.27-1

=
Bug descri= ption: grep behaves weirdly when searching hex values.

How to reproduce:
$=C2=A0printf=C2=A0'\x53\xef= ' |=C2=A0grep -aoP '\x53\xef'
(no output, returns 1)
$=C2=A0printf '\x53\xc3\xaf'= |=C2=A0grep -aoP '\x53\xef'
S=C3=AF
$=C2=A0printf '\x53\xc3\xef' |=C2=A0grep -aoP '\x53\xef'
(no output, = returns 1)

grep (version 2.= 12-2) provided by Debian works just fine.
--001a114697bc59de1d05451c730b-- From debbugs-submit-bounces@debbugs.gnu.org Mon Jan 02 13:30:42 2017 Received: (at 25336-done) by debbugs.gnu.org; 2 Jan 2017 18:30:42 +0000 Received: from localhost ([127.0.0.1]:39658 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cO7Na-0005fO-3e for submit@debbugs.gnu.org; Mon, 02 Jan 2017 13:30:42 -0500 Received: from zimbra.cs.ucla.edu ([131.179.128.68]:38940) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cO7NX-0005f9-Nw for 25336-done@debbugs.gnu.org; Mon, 02 Jan 2017 13:30:40 -0500 Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id 7F7DF1600A2; Mon, 2 Jan 2017 10:30:33 -0800 (PST) Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id vhIBc2b8-HNY; Mon, 2 Jan 2017 10:30:32 -0800 (PST) Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id CB9741600A6; Mon, 2 Jan 2017 10:30:32 -0800 (PST) X-Virus-Scanned: amavisd-new at zimbra.cs.ucla.edu Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id gURcek96Nn_d; Mon, 2 Jan 2017 10:30:32 -0800 (PST) Received: from [192.168.1.9] (unknown [47.153.178.162]) by zimbra.cs.ucla.edu (Postfix) with ESMTPSA id B07A11600A2; Mon, 2 Jan 2017 10:30:32 -0800 (PST) Subject: Re: bug#25336: To: Zepp Lu , 25336-done@debbugs.gnu.org References: From: Paul Eggert Organization: UCLA Computer Science Department Message-ID: <5518f57d-bcd3-e2bc-7f1d-05ed2f68e8e4@cs.ucla.edu> Date: Mon, 2 Jan 2017 10:30:32 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.5.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: quoted-printable X-Spam-Score: -3.2 (---) X-Debbugs-Envelope-To: 25336-done X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.2 (---) Zepp Lu wrote: > $ printf '\x53\xef' | grep -aoP '\x53\xef' > (no output, returns 1) > $ printf '\x53\xc3\xaf' | grep -aoP '\x53\xef' > S=C3=AF > $ printf '\x53\xc3\xef' | grep -aoP '\x53\xef' > (no output, returns 1) I don't see a bug here. PCRE patterns like \xef match code points, not by= tes, so=20 the PCRE notation differs from the shell printf notation. If your locale = uses=20 UTF-8, the PCRE pattern \xef matches the Unicode character U+00EF LATIN S= MALL=20 LETTER I WITH DIAERESIS, which is represented by the byte pair C3 AF. If you want \xef to match a single byte, run grep in a single-byte locale= , e.g.,=20 set LC_ALL=3DC in the environment. > grep (version 2.12-2) provided by Debian works just fine. Actually, it's buggy in this area. Sometimes it can dump core. From unknown Thu Jun 19 12:36:55 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Tue, 31 Jan 2017 12:24:03 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator