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.1 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FROM,HTML_MESSAGE,MAILING_LIST_MULTI autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 27138 invoked from network); 17 Sep 2021 09:32:52 -0000 Received: from minnie.tuhs.org (45.79.103.53) by inbox.vuxu.org with ESMTPUTF8; 17 Sep 2021 09:32:52 -0000 Received: by minnie.tuhs.org (Postfix, from userid 112) id C91F69CACA; Fri, 17 Sep 2021 19:32:49 +1000 (AEST) Received: from minnie.tuhs.org (localhost [127.0.0.1]) by minnie.tuhs.org (Postfix) with ESMTP id 0453C9CAB3; Fri, 17 Sep 2021 19:32:17 +1000 (AEST) Authentication-Results: minnie.tuhs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="CloznyjQ"; dkim-atps=neutral Received: by minnie.tuhs.org (Postfix, from userid 112) id 13DB99CAB3; Fri, 17 Sep 2021 19:32:14 +1000 (AEST) Received: from mail-pl1-f174.google.com (mail-pl1-f174.google.com [209.85.214.174]) by minnie.tuhs.org (Postfix) with ESMTPS id D08FE9CAB2 for ; Fri, 17 Sep 2021 19:32:11 +1000 (AEST) Received: by mail-pl1-f174.google.com with SMTP id o8so5823527pll.1 for ; Fri, 17 Sep 2021 02:32:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=o/fuIkkoN99RcyKKNd+UGskC6UEPumzihFOPeCBk6wo=; b=CloznyjQlX8CSuIC/ZTT+ThmNgxghjITMzypqOQhA5BbO8CZXLpK2NFmhGTwO+eiz6 Ssa3ht6V0Lj0Qd8cJjChMCLEJ971/plpZwGyzDby1VizlvKx+Iz8gozf4atXlZLn7MAf Hq940FOTlz2T/xF1BAlIdjaxXUCWvvNb39/K/B7bT276Jt4W8CrCqXX+n2sFrhRuzFwh zILIbA56cM+a4+ef8LOqU79S/yQOcOJtrsV+5tVrewkABeynmB6UXIcrRAzeDxh/GW7N L+Hgl3YET5DIEWT8i55yKR/iejiBHiWfyZfvU3FCvjp5vBJAS955tu5lW3oKFLZalggM rajw== 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=o/fuIkkoN99RcyKKNd+UGskC6UEPumzihFOPeCBk6wo=; b=kJmAar/8kjUos6A7L6u4YDwX8UV59kLx7ykJDkCMWLMBzgd6ZfeSC9BCXxqZ+qfzdG KbeJhP3cCv68SJa29uj2J7964h/GzdHyqjEHaGmQHpY28HgTMpntjgBZcSi+KaC1Axmf 5dIgKtTbXEpWhpK/8ywtXc8WBDvRdAjiOfe8Lw2Ra1JFV/f5dj2FMKwl7pbRGi8tXC+Z //5GtZXILaPWMcK+rPXlhUbB6PGTuvU2s1noLEBWgliB8M9xjxIndMAyfI3t7t5LF6uy 3hH8F65UjzoWzSZR1HY01WtLl69Wq1EA0iFgEC5w4ik/mXx5dk3LKemMn7x2GyBzLQv8 WD1g== X-Gm-Message-State: AOAM5309Y653wyazUbuEEwuISHS/uA7q/3yTF+ZjfxUEibLjN0ILYuj5 wnQAap64Ie/c+Uasukov+LItDijLKyJTbD0cfDqenVC4 X-Google-Smtp-Source: ABdhPJx/mxTAE2p2CHbPpQI/DmgG7H+hqs2n6CcieiHbtNDM/ZS9kxdBWeBgpcG5KbZCmssZRg40ygv3U4hXy1q2MfY= X-Received: by 2002:a17:90b:4a44:: with SMTP id lb4mr20123596pjb.140.1631871131022; Fri, 17 Sep 2021 02:32:11 -0700 (PDT) MIME-Version: 1.0 References: <1mR9bE-8RG-00@marmaro.de> In-Reply-To: <1mR9bE-8RG-00@marmaro.de> From: Rob Pike Date: Fri, 17 Sep 2021 19:32:00 +1000 Message-ID: To: markus schnalke Content-Type: multipart/alternative; boundary="00000000000015796705cc2d9ba1" Subject: Re: [TUHS] RegExp decision for meta characters: Circumflex 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" --00000000000015796705cc2d9ba1 Content-Type: text/plain; charset="UTF-8" You'd have to ask ken why he chose the characters he did, but I can answer the second question. The beginning and end of line are the same. If you make ^ mean both beginning and end of line, what does this ed command do: s/^/x/ Which end gets the x? -rob On Fri, Sep 17, 2021 at 7:00 PM markus schnalke wrote: > Hoi, > > I'm interested in the early design decisions for meta characters > in REs, mainly regarding Ken's RE implementation in ed. > > Two questions: > > 1) Circumflex > > As far as I see, the circumflex (^) is the only meta character that > has two different special meanings in REs: First being the > beginning of line anchor and second inverting a character class. > Why was it chosen for the second one? Why not the exclamation mark > in that case? (Sure, C didn't exist by then, but the bang probably > was used to negate in other languages of the time, I think.) > > 2) Symbol for the end of line anchor > > What is the reason that the beginning of line and end of line > anchors are different symbols? Is there a reason why not only one > symbol, say the circumflex, was chosen to represent both? I > currently see no disadvantages of such a design. (Circumflexes > aren't likely to end lines of text, neither.) > > I would appreciate if you could help me understand these design > decisions better. Maybe there existed RE notations that were simply > copied ... > > > meillo > --00000000000015796705cc2d9ba1 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
You'd have to ask ken why he chose the characters he d= id, but I can answer the second question. The beginning and end of line are= the same. If you make ^ mean both beginning and end of line, what does thi= s ed command do:

s/^/x/

Which e= nd gets the x?

-rob


=
On Fri, Se= p 17, 2021 at 7:00 PM markus schnalke <meillo@marmaro.de> wrote:
Hoi,

I'm interested in the early design decisions for meta characters
in REs, mainly regarding Ken's RE implementation in ed.

Two questions:

1) Circumflex

As far as I see, the circumflex (^) is the only meta character that
has two different special meanings in REs: First being the
beginning of line anchor and second inverting a character class.
Why was it chosen for the second one? Why not the exclamation mark
in that case? (Sure, C didn't exist by then, but the bang probably
was used to negate in other languages of the time, I think.)

2) Symbol for the end of line anchor

What is the reason that the beginning of line and end of line
anchors are different symbols? Is there a reason why not only one
symbol, say the circumflex, was chosen to represent both? I
currently see no disadvantages of such a design. (Circumflexes
aren't likely to end lines of text, neither.)

I would appreciate if you could help me understand these design
decisions better. Maybe there existed RE notations that were simply
copied ...


meillo
--00000000000015796705cc2d9ba1--