From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=MAILING_LIST_MULTI, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 8680 invoked from network); 30 May 2022 07:38:21 -0000 Received: from minnie.tuhs.org (50.116.15.146) by inbox.vuxu.org with ESMTPUTF8; 30 May 2022 07:38:21 -0000 Received: from minnie.tuhs.org (localhost [IPv6:::1]) by minnie.tuhs.org (Postfix) with ESMTP id 301C140B44; Mon, 30 May 2022 17:38:19 +1000 (AEST) Received: from relay05.pair.com (relay05.pair.com [216.92.24.67]) by minnie.tuhs.org (Postfix) with ESMTPS id A7B7040979 for ; Mon, 30 May 2022 17:38:12 +1000 (AEST) Received: from orac.inputplus.co.uk (unknown [84.51.159.244]) by relay05.pair.com (Postfix) with ESMTP id B49131A281A for ; Mon, 30 May 2022 03:38:11 -0400 (EDT) Received: from orac.inputplus.co.uk (orac.inputplus.co.uk [IPv6:::1]) by orac.inputplus.co.uk (Postfix) with ESMTP id C112921F8A for ; Mon, 30 May 2022 08:38:10 +0100 (BST) To: Computer Old Farts Followers From: Ralph Corderoy MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit In-reply-to: References: Date: Mon, 30 May 2022 08:38:10 +0100 Message-Id: <20220530073810.C112921F8A@orac.inputplus.co.uk> Message-ID-Hash: RX43ZYPO6B6LM4HG63U4QYZ4QQQNVIE2 X-Message-ID-Hash: RX43ZYPO6B6LM4HG63U4QYZ4QQQNVIE2 X-MailFrom: ralph@inputplus.co.uk X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.6b1 Precedence: list Subject: [COFF] Re: Grep has gone overboard List-Id: Computer Old Farts Forum Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Hi Dave, > I'm trying to find a regex i.e. as used by GREP to find all words in > "badugly" with each letter used only once and all are 7-letter words i.e. > they are all anagrams I tend to use egrep(1), as that's what my ~/bin/g runs, but sticking with grep and its Basic Regular Expressions, as asked, I'd use $ grep -v '[^badugly]' /usr/share/dict/words | > grep '^.\{7\}$' | > grep -v '\(.\).*\1' ladybug $ Note that uses my locale. Section 9 of POSIX has the detail, https://pubs.opengroup.org/onlinepubs/9699919799/. > I'll guess that it involves some obscure use of "{}*\" etc, which I've > never really grokked... If you want it explained on the list, let me know. -- Cheers, Ralph.