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=-0.8 required=5.0 tests=DKIM_ADSP_CUSTOM_MED, DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FROM,MAILING_LIST_MULTI autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 487 invoked from network); 3 Mar 2023 13:12:13 -0000 Received: from minnie.tuhs.org (2600:3c01:e000:146::1) by inbox.vuxu.org with ESMTPUTF8; 3 Mar 2023 13:12:13 -0000 Received: from minnie.tuhs.org (localhost [IPv6:::1]) by minnie.tuhs.org (Postfix) with ESMTP id 99A37432FE; Fri, 3 Mar 2023 23:12:10 +1000 (AEST) Received: from mail-lf1-x131.google.com (mail-lf1-x131.google.com [IPv6:2a00:1450:4864:20::131]) by minnie.tuhs.org (Postfix) with ESMTPS id 234AC432DE for ; Fri, 3 Mar 2023 23:12:02 +1000 (AEST) Received: by mail-lf1-x131.google.com with SMTP id s22so3491070lfi.9 for ; Fri, 03 Mar 2023 05:12:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=SwVc9Ja2z67GNj6MFGM1XmB9HezvtfsoMJuJt0DktPk=; b=H7ucs76ohogdoHmSqjKLe0KLwt+AjDvjR8QKNIb3To8NZLVzpx1P1OLI/vdV8HEZn1 k1AotS5IGw7pwhTPSCENj1+HM8UgPX3KM+PjYOsJcuK7qv3Kv6ozWSVRG4uaNvbr1/nX f1wh/5SvK9u/dVzxTWqUkonvmppZhmGqi7UaA4P6/hEb9rAt/3Mj9NhPbRl5fKHzkdml f9GPh7eJgr8kDGZNh4HmNCaZ/kywY57J5FJ3s7Hx4jxmXk4d7M59czYWEFYb6PSASCzy iRZsWJG2Uz4FMMN8gnGGGmowQGPai5DJuiI5rVYskp6k+bSThhti5XS1CCwjW2LrwJXQ DY0w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=SwVc9Ja2z67GNj6MFGM1XmB9HezvtfsoMJuJt0DktPk=; b=sg1bcAoUmtrdZ8wljLy1gQLpgQqhjPoyby+85R1yXx/VkLTtwN3NwDMQqUopD+2/cJ rUl0M79FDccZnVW+QsVVM2C2IaFKQ5wj5uP82XcWcqCGct9bwEQDCNMqWezIDaQnB5J8 gM+B9ra6Jda1tvVK5YJAmpQPaA/KB2nS9/XE1mV7sGiCgl1sMJj3XkcGHtw72pVyYctv e/zyNyvZEV/Z3jr13kaW+IOnvsL7shZMbNaoNEw9P6uisen1oXzsLEgfOYH1xqSaiLSW wEflhZQxvux2+c97lmDtsS4ifqrgMeQkPjEOaNepzkhrOeD1x6VtHbzOsdiQ1wyGA5Gf mPvg== X-Gm-Message-State: AO0yUKUkZaXUbinna3BwhTq/GaEAA3zLImbSGi52a8gZOt7crKkHDNqu LB8tMHK0cKH8wym1fWKwWXCZRM6EC/7C9Gt55i0iF3zAilM= X-Google-Smtp-Source: AK7set+EbcORrNL9JGGzuLHpljLBwM6L6tRKysAJzTnZa8OPDGXMCJWnpebgqSGXVsVFllP5CgH8utAs3sn861Bb2tc= X-Received: by 2002:a05:6512:3c83:b0:4d8:86c2:75ea with SMTP id h3-20020a0565123c8300b004d886c275eamr2815847lfv.3.1677849119821; Fri, 03 Mar 2023 05:11:59 -0800 (PST) MIME-Version: 1.0 References: <8d1de5c8-1f34-3d37-395d-0f1da7b062ec@spamtrap.tnetconsulting.net> <20230303105928.E88AB215AA@orac.inputplus.co.uk> In-Reply-To: <20230303105928.E88AB215AA@orac.inputplus.co.uk> From: Dan Cross Date: Fri, 3 Mar 2023 08:11:23 -0500 Message-ID: To: Ralph Corderoy Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Message-ID-Hash: JFIVALXQ24NFKV7PXCBHGNYOF5LS5CEX X-Message-ID-Hash: JFIVALXQ24NFKV7PXCBHGNYOF5LS5CEX X-MailFrom: crossd@gmail.com 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 CC: coff@tuhs.org X-Mailman-Version: 3.3.6b1 Precedence: list Subject: [COFF] Re: Requesting thoughts on extended regular expressions in grep. List-Id: Computer Old Farts Forum Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: On Fri, Mar 3, 2023 at 5:59=E2=80=AFAM Ralph Corderoy wrote: > [snip] > > If you want to understand: > > - the maths of regular expressions, > - the syntax of regexps which these days expresses more than REs, and > - the regexp engines in programs, the differences in how they work and > what they match, and > - how to efficiently steer an engine's internals > > then I recommend Jeffrey Friedl's Mastering Regular Expressions. > http://regex.info/book.html I'm afraid I must sound a note of caution about Friedl's book. Russ Cox alludes to some of the problems in the "History and References" section of his page (https://swtch.com/~rsc/regexp/regexp1.html), that was linked earlier, and he links to this post: http://regex.info/blog/2006-09-15/248 The impression is that Friedl shows wonderfully how to _use_ regular expressions, but does not understand the theory behind their implementation. It is certainly true that today what many people refer to as "regular expressions" are not in fact regular (and require a pushdown automata to implement, putting them somewhere between REs and the context-free languages in terms of expressiveness). Personally, I'd stick with Russ's stuff, especially as `egrep` is the target here. - Dan C.