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_INVALID,DKIM_SIGNED, HTML_MESSAGE,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 26129 invoked from network); 1 Aug 2020 01:32:35 -0000 Received: from minnie.tuhs.org (45.79.103.53) by inbox.vuxu.org with ESMTPUTF8; 1 Aug 2020 01:32:35 -0000 Received: by minnie.tuhs.org (Postfix, from userid 112) id 9FE449CB41; Sat, 1 Aug 2020 11:32:28 +1000 (AEST) Received: from minnie.tuhs.org (localhost [127.0.0.1]) by minnie.tuhs.org (Postfix) with ESMTP id 84ECE9C9E3; Sat, 1 Aug 2020 11:31:46 +1000 (AEST) Authentication-Results: minnie.tuhs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=iitbombay-org.20150623.gappssmtp.com header.i=@iitbombay-org.20150623.gappssmtp.com header.b="mhTHbhrQ"; dkim-atps=neutral Received: by minnie.tuhs.org (Postfix, from userid 112) id 9BB929C9E3; Sat, 1 Aug 2020 11:31:43 +1000 (AEST) Received: from mail-pf1-f182.google.com (mail-pf1-f182.google.com [209.85.210.182]) by minnie.tuhs.org (Postfix) with ESMTPS id 4A78F93DFC for ; Sat, 1 Aug 2020 11:31:42 +1000 (AEST) Received: by mail-pf1-f182.google.com with SMTP id z188so7455563pfc.6 for ; Fri, 31 Jul 2020 18:31:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=iitbombay-org.20150623.gappssmtp.com; s=20150623; h=from:message-id:mime-version:subject:date:in-reply-to:cc:to :references; bh=Yvlgp+RRPJWhjBVczbQRl2V+ZQyiBjbWo3hGGjufwSo=; b=mhTHbhrQSe+iRHNE/eoEwR9ktzLDjQ3grmB39KaiCdlauR9mTuXVpF4/JT75kj40SX KKikQMQ0Jxwnvk0cshByxGLvss53iW5+cIB08zpQWoVhzoklK4vtMCP8aio2rXnFB+57 pkj13D3fqMDGIUdUpeDjF+oZF1eAW2utGwhnWNZsRW/YttAlxxQ3EbKQYheGFuLzlZxV HBVPYeQm+G5DMKZ0xOzmJf766w7CyLQpd848Gmr+zBc7ovqNLYb8+IyMjgJskZ5alJuw zG/hagLYUSPQ6G+xYZNQjlDFLz5gVYdjErWf+Jm9QwSldKz5FY+5iiHtjCh2X3WJW7eO k7sg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:message-id:mime-version:subject:date :in-reply-to:cc:to:references; bh=Yvlgp+RRPJWhjBVczbQRl2V+ZQyiBjbWo3hGGjufwSo=; b=RiaBRkA+7+76MvcMhXM9aCR4fICT4WmlBk489xg5QBGKu7slwRd2Woy4qKQZugvXrL 4EJPYZScoKWgfolANw6CfLAq+OYxjaLS4dI6qchwk63tymIvPU3HtEWbD0QmWnqnSHyV aoBLaheQzO/nMagV8Tn3YR10+F1pK8iK0R5dY6wJO14HQb7d6f+O/jRMinLj/Z+Ojsmq 8CvUxVesp/dN5zDSwMPyXNzBUbEChJG1hEezfUHnFlABAhwp2o/VdfC3/NEJW2qL7Rkp hpKZHRPoYN9rdZsVy+EjaUMzPrJW9mnRbd3R0Ur6KZAK57fG1ohrPlsbGZlxnF49/Drn 4YqA== X-Gm-Message-State: AOAM530xIw+6I4XYoqEdjMkfy4bkYPt8eyYkM3Bbj5QPPCPvez9WxD6a 4hi3tEsA+gs6R1sx/jcpq1AHsw== X-Google-Smtp-Source: ABdhPJxCaRWHXEyVFDDh6qREqcR/v4ycRVj09s2LUWq1xRQUfB/Sli7AtT16hW5aYmLgpM5r6rWBhQ== X-Received: by 2002:a62:ac05:: with SMTP id v5mr6295341pfe.8.1596245501545; Fri, 31 Jul 2020 18:31:41 -0700 (PDT) Received: from 107-215-223-226.lightspeed.sntcca.sbcglobal.net (107-215-223-226.lightspeed.sntcca.sbcglobal.net. [107.215.223.226]) by smtp.gmail.com with ESMTPSA id g18sm11467487pfi.141.2020.07.31.18.31.40 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 31 Jul 2020 18:31:40 -0700 (PDT) From: Bakul Shah Message-Id: <3D47666B-BF70-4810-9D43-CAE16E44F25D@iitbombay.org> Content-Type: multipart/alternative; boundary="Apple-Mail=_A9F674B7-7953-4D0D-8BD5-F682052842CB" Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.15\)) Date: Fri, 31 Jul 2020 18:31:39 -0700 In-Reply-To: To: Rob Pike References: <6e9ca056-dfb0-376d-effd-e41c9ed3ef2a@gmail.com> <402F66B1-12C1-4FED-89FD-38AB99D919B4@iitbombay.org> X-Mailer: Apple Mail (2.3445.104.15) Subject: Re: [TUHS] Regular Expressions X-BeenThere: tuhs@minnie.tuhs.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: The Unix Heritage Society mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: TUHS main list Errors-To: tuhs-bounces@minnie.tuhs.org Sender: "TUHS" --Apple-Mail=_A9F674B7-7953-4D0D-8BD5-F682052842CB Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii I was trying to get Will to try simple stuff out himself from first = principles (to get started) but this is of course far better! > On Jul 31, 2020, at 5:36 PM, Rob Pike wrote: >=20 > I think this link - https://swtch.com/~rsc/regexp/regexp1.html = i- s the best place to = start. Superb exposition on the background, theory, and implementation = as well as a bit of history of how the industry lost its way with = regular expressions. >=20 > Regular expressions are beautiful, simple, and widely misunderstood. >=20 > -rob >=20 >=20 > On Sat, Aug 1, 2020 at 10:03 AM Bakul Shah > wrote: > On Jul 31, 2020, at 3:57 PM, Will Senn > wrote: > >=20 > > I've always been intrigued with regexes. When I was first exposed to = them, I was mystified and lost in the greediness of matches. Now, I use = them regularly, but still have trouble using them. I think it is because = I don't really understand how they work. > > ... > > 1. What's the provenance of regex in unix (when did it appear, in = what form, etc)? > > 2. What are the 'best' implementations throughout unix (keep it pre = 1980s)? > > 3. What are some of the milestones along the way (major changes, = forks, disagreements)? > > 4. Where, in the source, or in a paper, would you point someone to = wanting to better understand the mechanics of regex? >=20 > Start here: https://en.wikipedia.org/wiki/Thompson%27s_construction = >=20 > [I learned about regular expressions in an automata theory class,=20 > before I knew anything about Unix. What helped me was learning > about finite state machines. You won't need more than paper and > pencil to construct one. Reading source code would make more > sense once you grasp how to construct a FSM corresponding to a RE.] --Apple-Mail=_A9F674B7-7953-4D0D-8BD5-F682052842CB Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=us-ascii I = was trying to get Will to try simple stuff out himself from first = principles (to get started) but this is of course far better!

On Jul 31, 2020, at 5:36 PM, Rob Pike <robpike@gmail.com> = wrote:

I think this link -  https://swtch.com/~rsc/regexp/regexp1.html i- s the = best place to start. Superb exposition on the background, theory, and = implementation as well as a bit of history of how the industry lost its = way with regular expressions.

Regular expressions are beautiful, simple, and widely = misunderstood.

-rob


On Sat, Aug 1, 2020 at 10:03 AM Bakul Shah <bakul@iitbombay.org>= wrote:
On Jul 31, 2020, at 3:57 PM, Will = Senn <will.senn@gmail.com> wrote:
>
> I've always been intrigued with regexes. When I was first exposed = to them, I was mystified and lost in the greediness of matches. Now, I = use them regularly, but still have trouble using them. I think it is = because I don't really understand how they work.
> ...
> 1. What's the provenance of regex in unix (when did it appear, in = what form, etc)?
> 2. What are the 'best' implementations throughout unix (keep it pre = 1980s)?
> 3. What are some of the milestones along the way (major changes, = forks, disagreements)?
> 4. Where, in the source, or in a paper, would you point someone to = wanting to better understand the mechanics of regex?

Start here: https://en.wikipedia.org/wiki/Thompson%27s_construction

[I learned about regular expressions in an automata theory class,
 before I knew anything about Unix. What helped me was learning
 about finite state machines. You won't need more than paper and
 pencil to construct one. Reading source code would make more
 sense once you grasp how to construct a FSM corresponding to a = RE.]

= --Apple-Mail=_A9F674B7-7953-4D0D-8BD5-F682052842CB--