From debbugs-submit-bounces@debbugs.gnu.org Thu Feb 17 09:50:03 2022 Received: (at submit) by debbugs.gnu.org; 17 Feb 2022 14:50:03 +0000 Received: from localhost ([127.0.0.1]:50548 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nKi6c-00008h-Fl for submit@debbugs.gnu.org; Thu, 17 Feb 2022 09:50:03 -0500 Received: from lists.gnu.org ([209.51.188.17]:34232) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nKi3w-0008TJ-NW for submit@debbugs.gnu.org; Thu, 17 Feb 2022 09:47:17 -0500 Received: from eggs.gnu.org ([209.51.188.92]:48734) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nKi3v-0007HZ-AV for bug-grep@gnu.org; Thu, 17 Feb 2022 09:47:16 -0500 Received: from casper.infradead.org ([90.155.50.34]:41916) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nKi3s-0003YE-9k for bug-grep@gnu.org; Thu, 17 Feb 2022 09:47:14 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=Content-Type:MIME-Version:Message-ID: Subject:To:From:Date:Sender:Reply-To:Cc:Content-Transfer-Encoding:Content-ID: Content-Description:In-Reply-To:References; bh=H+QqsRafyc896GICEb/fGlEP0TEqKnwKDJqK/x/ER9Y=; b=BNQtFG73n6SN7XNa2cErMZPcqB yBJ9bUODmdVTi6zY+nG9irEJ9TAUF5Vjn5UmqzJoK1NXY+CagXNkSmHwaZFlCaF7EezDwmKiwD9wW GV67KBqBVXd28ulASs5N+3MDtv77B/fXQQOZfBavJVpDjmNs0YrPDxAyu83ALdMRc1ooF1yuP5sFD TtfewQR8aCkmXG4G4RFlbeY35KD85RhpPBUXqqVmBAD59e9X7ereaXUaFtdQqU41NZ8mP2Z/7UcNV Sfbb4lUamAvuH6fNYZQebWKOGhVF1/8As7mGfZKRxEKZd7TrY3pdWcHOmt6NnbwgolIK2HK6BAuQW EkGm42Jw==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1nKi3k-00FhCU-VU for bug-grep@gnu.org; Thu, 17 Feb 2022 14:47:05 +0000 Date: Thu, 17 Feb 2022 14:47:04 +0000 From: Matthew Wilcox To: bug-grep@gnu.org Subject: Simple regexp bug [contains spoiler for today's wordle] Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Received-SPF: none client-ip=90.155.50.34; envelope-from=willy@infradead.org; helo=casper.infradead.org X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_NONE=0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: submit X-Mailman-Approved-At: Thu, 17 Feb 2022 09:50:01 -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: -3.3 (---) I noticed this one while doing: $ grep sha[^s]e five-letter-words share which doesn't fit with: $ grep sha.e five-letter-words shade shake shale shame shape share shave A reproducer is easy: $ echo shame |grep sha[^s]e (no output) Almost any change to the regex & input will make it work, even rot-13 of both. For example: $ echo shamel |grep sha[^s]e (no output, still fails) $ echo shamel |grep sha[^s]el shamel $ echo sshame |grep ssha[^s]e sshame $ echo funzr |grep fun[^f]r funzr $ grep --version grep (GNU grep) 3.7 Copyright (C) 2021 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later . This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Written by Mike Haertel and others; see . This is Debian amd64, grep package version 3.7-1. From debbugs-submit-bounces@debbugs.gnu.org Thu Feb 17 11:14:15 2022 Received: (at 54043-done) by debbugs.gnu.org; 17 Feb 2022 16:14:15 +0000 Received: from localhost ([127.0.0.1]:52521 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nKjQ7-0002nX-0E for submit@debbugs.gnu.org; Thu, 17 Feb 2022 11:14:15 -0500 Received: from mail-yw1-f175.google.com ([209.85.128.175]:34798) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nKjQ4-0002nI-G8 for 54043-done@debbugs.gnu.org; Thu, 17 Feb 2022 11:14:13 -0500 Received: by mail-yw1-f175.google.com with SMTP id 00721157ae682-2d625082ae2so37261427b3.1 for <54043-done@debbugs.gnu.org>; Thu, 17 Feb 2022 08:14:12 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=4fXn0thBfZKL6CK9a37xDbdhaMheQ8UwEg94qWX+CMc=; b=3cC9xOAw0wmMmxw2zulV/2p6ZDbysUPLwSbs2TNvhuvGkBX2nUrqpH3k79IYHoym2W rmyRXnVpe2Z9bFtXJCs8NFeu8IHdk4ZfJWltMBHEvJ/43sLZgDBnAOA0JYDLRGuoaBqV nLSbCpCnbt8yDR/jE18gN/YzOxJEEEs888GwHs9mbtcvf7F53yy4K8modLx2jPcnmakS 1j23xzYCkwHB6US4SahEB1LBxTmoJ3U3ZMawaAvGRXnwymwxWmp/cPvyPIwuLH36CK8u QRywp+KMwj/Wc8MBKERB7FAQObQxNwFLG8KRXfMwUquTfSbYURTw/CH8Zghv+TaK49hE S7jA== X-Gm-Message-State: AOAM531Mon2JFzi7SA54uwhmGmZHge1CnWCLb0l4D/DI0eEtfeqI1Qx5 LOs3yUy9HSyjtTRH1LrW1OmN3P+b/5TYcaO8HFQX0lGTohc= X-Google-Smtp-Source: ABdhPJz5sMoT3uuO60Lh9Hw5pZDAXjd+XXbzQHAYEpPrc9YQ5yFDvEAdNU1w5pgNNeCbtz/cnXdyTUnfprgum1Ijsnc= X-Received: by 2002:a81:ad1e:0:b0:2d0:7c3a:9f76 with SMTP id l30-20020a81ad1e000000b002d07c3a9f76mr3160834ywh.479.1645114446845; Thu, 17 Feb 2022 08:14:06 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: Jim Meyering Date: Thu, 17 Feb 2022 08:13:54 -0800 Message-ID: Subject: Re: bug#54043: Simple regexp bug [contains spoiler for today's wordle] To: Matthew Wilcox Content-Type: text/plain; charset="UTF-8" X-Spam-Score: 0.5 (/) X-Debbugs-Envelope-To: 54043-done Cc: 54043-done@debbugs.gnu.org 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: -0.5 (/) On Thu, Feb 17, 2022 at 7:46 AM Matthew Wilcox wrote: > I noticed this one while doing: > > $ grep sha[^s]e five-letter-words > share > > which doesn't fit with: > > $ grep sha.e five-letter-words > shade > shake > shale > shame > shape > share > shave > > A reproducer is easy: > > $ echo shame |grep sha[^s]e > (no output) This is not a bug in grep. Your failure to quote the regular expression means that the argument is first interpreted by the shell. To demonstrate the argument that "grep" ends up using, run this from that same directory: echo sha[^s]e If I have something named e.g., "shape" in the current directory, that would print "shape". If I have two matching names, e.g., shave and shale, it will print both names. IMHO, it is almost always best to single-quote regular expressions like that. Quoting your reproducer, you see it works as desired: $ echo shame |grep 'sha[^s]e' shame From debbugs-submit-bounces@debbugs.gnu.org Thu Feb 17 12:47:40 2022 Received: (at 54043-close) by debbugs.gnu.org; 17 Feb 2022 17:47:40 +0000 Received: from localhost ([127.0.0.1]:52631 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nKksT-0007QH-LW for submit@debbugs.gnu.org; Thu, 17 Feb 2022 12:47:40 -0500 Received: from casper.infradead.org ([90.155.50.34]:35332 ident=exim) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nKijP-0001cB-CI for 54043-close@debbugs.gnu.org; Thu, 17 Feb 2022 10:30:12 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:To:From:Date:Sender:Reply-To:Cc: Content-Transfer-Encoding:Content-ID:Content-Description; bh=kpEqIasjW0AUPcSPuvFeQkfgf/w2ExY8ab3KellUNHU=; b=LJMp67jpbN124JsUCBHVdri1h7 Mmru58SM/KC1An82SCBv4MHV9oN9tUdDPy4aFN1jSo/5UATa9H5WEjcWzAXao41F8CwwmWwdIpKsQ YdCOegfjDOF/0+/DECYIavUrHxV30aZ7YrZXRhpMAzwC7POzTHscvo2h7BR90uQxgnQ48k7yXyG23 7gNk6kUJIRJDtsPUvK56CpCB1lbfM6r8ybEqyKw+axrpirHb9Yla+RoXOrkYt/zDNa2679hAa5XA4 /QSX73SIiyOp9A6y5bq60kgNgR6TDYBMuATWpDA7t7WtjnNM6cR1qMjY36k8o27wSv1EDyZ7hGT2q 0MzIKydQ==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1nKijN-00Fj1V-Ab for 54043-close@debbugs.gnu.org; Thu, 17 Feb 2022 15:30:05 +0000 Date: Thu, 17 Feb 2022 15:30:05 +0000 From: Matthew Wilcox To: 54043-close@debbugs.gnu.org Subject: Re: bug#54043: Acknowledgement (Simple regexp bug [contains spoiler for today's wordle]) Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 54043-close X-Mailman-Approved-At: Thu, 17 Feb 2022 12:47:36 -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.0 (-) Never mind. bash glob-expanded 'sha[^s]e' to match 'share' which was a directory in $HOME. Eventually, I'll learn to quote correctly. From unknown Fri Jun 20 20:01:51 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Fri, 18 Mar 2022 11:24:04 +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