From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-0.6 required=5.0 tests=DKIM_ADSP_CUSTOM_MED, DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,HTML_MESSAGE,MAILING_LIST_MULTI, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.4 Received: from minnie.tuhs.org (minnie.tuhs.org [50.116.15.146]) by inbox.vuxu.org (Postfix) with ESMTP id 7D4BF242C6 for ; Mon, 4 Mar 2024 09:17:39 +0100 (CET) Received: from minnie.tuhs.org (localhost [IPv6:::1]) by minnie.tuhs.org (Postfix) with ESMTP id 9FEC64369B; Mon, 4 Mar 2024 18:17:35 +1000 (AEST) Received: from mail-ua1-x934.google.com (mail-ua1-x934.google.com [IPv6:2607:f8b0:4864:20::934]) by minnie.tuhs.org (Postfix) with ESMTPS id 7384F4369A for ; Mon, 4 Mar 2024 18:17:28 +1000 (AEST) Received: by mail-ua1-x934.google.com with SMTP id a1e0cc1a2514c-7db123701bcso854537241.2 for ; Mon, 04 Mar 2024 00:17:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1709540247; x=1710145047; darn=tuhs.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=Sq0J2OZ3+/oRbSwnafARQrJwg1HF7IM1O0PjxiIuwAU=; b=L1wCc8gF80aodDjdAr1X0g9uA/ZzgTRoJmC4uSC7axLqBPr7JzugnyqATrMjrVno6Z ZuuiJCmHbZU559HyQT7qXAoToE7CqGUaMGcD45bnrwxuFuxRWXmCAODaRJMZ93xhmr+N l2VNQgE5LqgfqgYmWV9LtW2RA6cFd+RiHbgHXQRI+HRBQWvGcl+lfI6KqdrkpnEBHJ/m rNGJaYtjV6pckBnkiO1NNfIkS8U7AKrDAIk5aIL4tLxPlyY+OjJiCUkJqyNweyCamE18 jUIEgc4x2qCGSOqPp0C2exv6SCv/d6cu/rhJFnuGwOT2MwS1E46JvE9Wix6wW6fUKkpV /wyg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709540247; x=1710145047; h=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=Sq0J2OZ3+/oRbSwnafARQrJwg1HF7IM1O0PjxiIuwAU=; b=lfO863S35cTCIYzYGyd9bP7EaKQtpmVu70HHfbdcrjDyZUkooxx+Xn4C7yW+YV4ouE H1aoqS1IQzmiWGV7HVUeDXvD1qh8B9sD6dnL5xUh07dNMo0pLO6rGrL2+3N4ubnPgetL sVj9RJ60eGajR/kpv9Q9+Vwn3QBWUtUqhjop6dcYvf8v27oMHqhX3Z8X5EcBKtFVK3V6 Suybnaa9OU/dYaASnXjLTLmLCnCfhdPX8Hs/MW9CL1vFlZohYmp4czYsmz/I+6yeu31X vjy7LfRYYMkMHkszMl8Fusp1FFEs8Mi3UDROAHaINDaHKZIb3uyzA/BxWtg3ZYrE0Zmc IBRw== X-Forwarded-Encrypted: i=1; AJvYcCWD+7A/y9JDX5jHyIap67UG6DPCzW+oe4qdacFx3Ztuj2iuz75CIYpb7KkHXdLLcrwhGgel+hj8X0M0Kfeu X-Gm-Message-State: AOJu0YzIh2Txseakj8AocT5/8roUZjy/XqjdhtTlgRACaCGGlHPm5Gt0 q0AYt1tK434M/BS1eGUdpJtY2tk6ksh7Ta1uJzxcUjgCXgWAxcA1fhjZdOIdKEdme6eoiCDSnJl sMsA5WQP9hX1fokvXcvXtnM78jLU= X-Google-Smtp-Source: AGHT+IEhdFYeWr2wvzEh/X4cO1sROeX4Vas4sM/tDPfoPI/7lrKXrvXSC5pRdKqd5kah1bGStMCDsuQ4PBzMof+nyr0= X-Received: by 2002:a05:6102:3092:b0:472:d146:6456 with SMTP id l18-20020a056102309200b00472d1466456mr323255vsb.15.1709540247022; Mon, 04 Mar 2024 00:17:27 -0800 (PST) MIME-Version: 1.0 References: <13abd764-984a-4c9f-8e3e-b1eb7c624692@gmail.com> <20240304033845.GB5304@mcvoy.com> In-Reply-To: <20240304033845.GB5304@mcvoy.com> From: Rob Pike Date: Mon, 4 Mar 2024 19:17:15 +1100 Message-ID: To: Larry McVoy Content-Type: multipart/alternative; boundary="00000000000027338b0612d15b7d" Message-ID-Hash: XCCPTQOXTEL2MJDVW7LGXMYV5KGW6G2H X-Message-ID-Hash: XCCPTQOXTEL2MJDVW7LGXMYV5KGW6G2H X-MailFrom: robpike@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: Marc Rochkind , Will Senn , TUHS X-Mailman-Version: 3.3.6b1 Precedence: list Subject: [TUHS] Re: regex early discussions List-Id: The Unix Heritage Society mailing list Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: --00000000000027338b0612d15b7d Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable If that's really true, that you learned from Spencer's library, then you didn't learn the most important thing about them, which is the automata theory that guarantees their performance is always linear. Not to take anything away from Henry, who admitted at the time that it could be slow for bad expressions, but we're still paying the price for refusing to connect "regex" with the theory that created them, ignoring it in fact. Background: https://swtch.com/~rsc/regexp/regexp1.html -rob On Mon, Mar 4, 2024 at 2:38=E2=80=AFPM Larry McVoy wrote: > Marc is right. I'll add that I grew up in terminal rooms, a bunch of > kids connected to a VAX 780, like 40 or more. I have no idea how the > kids ahead of me learned but I learned by looking at their terminal > and going "what did you just do?". > > My real understanding of regex is from Henry Spencer's regex. > > On Sun, Mar 03, 2024 at 07:03:39PM -0700, Marc Rochkind wrote: > > Will, here's my recollection, when I got to UNIX in late 1972 or > > thereabouts: > > > > First, there was ed. grep and sed were derived from ed, so came along > > later. awk came along way later. > > > > There were only manual pages. You typed "man ed" and there it was. The > man > > pages were very accurate, very clear, and very authoritative. Many foun= d > > them too succinct, especially as UNIX got more popular, but all of us > back > > in the day found them perfect. Maybe you had to read the man page a few > > times to understand it, but at least that's all you had to read. No nee= d > to > > hunt around for more documentation! > > > > (Well, there was more documentation: The source code, which was all > online. > > But reading the ed source to understand regular expressions was > impossible. > > It was in assembler, and Ken was generating code on the fly as the > > expression was compiled.) > > > > Also, it should be noted that ed produced a single error message: a > > question mark. No wasting of teletype paper! > > > > The motivation for learning regular expressions was that that's how you > > edited files. ed was the only game in town. > > > > (sh used a greatly restricted form of regular expressions, which were > > documented on the sh man page.) > > > > Marc Rochkind > > > > On Sun, Mar 3, 2024 at 6:31???PM Will Senn wrote: > > > > > Hi All, > > > > > > I was wondering, what were the best early sources of information for > > > regexes and why did folks need to know them to use unix? In my recent > > > explorations, I have needed to have a better understanding of them, s= o > I'm > > > digging in... awk's my most recent thing and it's deeply associated > with > > > them, so here we are. I went to the bookshelf to find something > appropriate > > > and as usual, I've traced to primary sources to some extent. I starte= d > with > > > Mastering Regular Expressions by Friedl, and I won't knock it (it's > one of > > > the bestsellers in our field), but it's much to long for my personal > taste > > > and it's not quite as systematic as I would like (the author himself > notes > > > that his interests are less technical than authors preceding him on t= he > > > subject). So, back to the shelves... Bourne's, The Unix Environment, > and > > > Kernighan & Pike's, The Unix Programming Evironment both talk about > them in > > > the context of grep, ed, sed, and awk. Going further back, the Unix > > > Programmer's Manual v7 - ed, grep, sed, awk... > > > > > > After digging around it seems like folks needed regexes for ed, grep, > sed > > > and awk... and any other utility that leveraged the wonderful nature = of > > > these handy expressions. Fine. Where did folks go learn them? Was > there a > > > particularly good (succinct and accurate) source of information that > folks > > > kept handy? I'm imagining (based on what I've seen) that someone migh= t > cut > > > out the ed discussion or the grep pages of the manual and tape them t= o > > > their monitors, but maybe I'm stooopid and they didn't need no stinki= n' > > > memory device for regexes - surely they're intuitive enough that even= a > > > simpleton could pick them up after seeing a few examples... but if th= at > > > were really the case, Friedl's book would have been a flop and it > wasn't > > > :). So seriously, if you remember that far back - what was the > definitive > > > source of your regex knowledge and what were the first motivators for > > > learning them? > > > > > > Thanks, > > > > > > Will > > > > > > > > > -- > > *My new email address is mrochkind@gmail.com * > > -- > --- > Larry McVoy Retired to fishing > http://www.mcvoy.com/lm/boat > --00000000000027338b0612d15b7d Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
If that's really true, that you learned from Spencer's li= brary, then you didn't learn the most important thing about them, which= is the automata theory that guarantees their performance is always linear.= Not to take anything away from Henry, who admitted at the time that it cou= ld be slow for bad expressions, but we're still paying the price for re= fusing to connect "regex" with the theory that created them, igno= ring it in fact.


-rob


On Mon, Mar 4, 2024 at 2:38=E2=80=AFPM Larry McVoy <lm@mcvoy.com> wrote:
Marc is right.=C2=A0 I'll add that I grew up i= n terminal rooms, a bunch of
kids connected to a VAX 780, like 40 or more.=C2=A0 I have no idea how the<= br> kids ahead of me learned but I learned by looking at their terminal
and going "what did you just do?".

My real understanding of regex is from Henry Spencer's regex.

On Sun, Mar 03, 2024 at 07:03:39PM -0700, Marc Rochkind wrote:
> Will, here's my recollection, when I got to UNIX in late 1972 or > thereabouts:
>
> First, there was ed. grep and sed were derived from ed, so came along<= br> > later. awk came along way later.
>
> There were only manual pages. You typed "man ed" and there i= t was. The man
> pages were very accurate, very clear, and very authoritative. Many fou= nd
> them too succinct, especially as UNIX got more popular, but all of us = back
> in the day found them perfect. Maybe you had to read the man page a fe= w
> times to understand it, but at least that's all you had to read. N= o need to
> hunt around for more documentation!
>
> (Well, there was more documentation: The source code, which was all on= line.
> But reading the ed source to understand regular expressions was imposs= ible.
> It was in assembler, and Ken was generating code on the fly as the
> expression was compiled.)
>
> Also, it should be noted that ed produced a single error message: a > question mark. No wasting of teletype paper!
>
> The motivation for learning regular expressions was that that's ho= w you
> edited files. ed was the only game in town.
>
> (sh used a greatly restricted form of regular expressions, which were<= br> > documented on the sh man page.)
>
> Marc Rochkind
>
> On Sun, Mar 3, 2024 at 6:31???PM Will Senn <will.senn@gmail.com> wrote:
>
> > Hi All,
> >
> > I was wondering, what were the best early sources of information = for
> > regexes and why did folks need to know them to use unix? In my re= cent
> > explorations, I have needed to have a better understanding of the= m, so I'm
> > digging in... awk's my most recent thing and it's deeply = associated with
> > them, so here we are. I went to the bookshelf to find something a= ppropriate
> > and as usual, I've traced to primary sources to some extent. = I started with
> > Mastering Regular Expressions by Friedl, and I won't knock it= (it's one of
> > the bestsellers in our field), but it's much to long for my p= ersonal taste
> > and it's not quite as systematic as I would like (the author = himself notes
> > that his interests are less technical than authors preceding him = on the
> > subject). So, back to the shelves... Bourne's, The Unix Envir= onment, and
> > Kernighan & Pike's, The Unix Programming Evironment both = talk about them in
> > the context of grep, ed, sed, and awk. Going further back, the Un= ix
> > Programmer's Manual v7 - ed, grep, sed, awk...
> >
> > After digging around it seems like folks needed regexes for ed, g= rep, sed
> > and awk... and any other utility that leveraged the wonderful nat= ure of
> > these handy expressions. Fine. Where did folks go learn them? Was= there a
> > particularly good (succinct and accurate) source of information t= hat folks
> > kept handy? I'm imagining (based on what I've seen) that = someone might cut
> > out the ed discussion or the grep pages of the manual and tape th= em to
> > their monitors, but maybe I'm stooopid and they didn't ne= ed no stinkin'
> > memory device for regexes - surely they're intuitive enough t= hat even a
> > simpleton could pick them up after seeing a few examples... but i= f that
> > were really the case, Friedl's book would have been a flop an= d it wasn't
> > :). So seriously, if you remember that far back - what was the de= finitive
> > source of your regex knowledge and what were the first motivators= for
> > learning them?
> >
> > Thanks,
> >
> > Will
> >
>
>
> --
> *My new email address is mrochkind@gmail.com <mrochkind@gmail.com>*

--
---
Larry McVoy=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0Retired to fishing=C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 http://www.mcvoy.com/lm/boat
--00000000000027338b0612d15b7d--