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=-3.4 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FROM,HTML_MESSAGE,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 17486 invoked from network); 27 Jan 2023 10:02:02 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 27 Jan 2023 10:02:02 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20210803; t=1674813722; b=VW+xveiOgew8B4veHFpoxTPOURYxSil9Ti4gu/qMArOL7sHR8mNysstlH9huuObfza6Z88OvQ1 S0vuEsb/kBBuDsfrpwgAlbsllZ/Q1DeR5Be+Rg08h6ZrccH11D0V9TMjQpdLmBuD27XC1GxFJN HaO95CXx7nBsJRfGHgNddM3nVT7rFSJ5aL37xErnxxu2zOiHzzLBQhOzAtSqNN2y9IDnuO5o0P Ni2rH37kXmWXc1UKCoW8/BZ763d1r2EDCxTwyQn8GD6VY5TSfUyxQBS5rygAx/ioeobQPAj9g9 8bXplLtuKSSLR8XovNc7oPwTzPiBibYAmEbLE4jOmTLPig==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (mail-lf1-f54.google.com) smtp.remote-ip=209.85.167.54; dkim=pass header.d=gmail.com header.s=20210112 header.a=rsa-sha256; dmarc=pass header.from=gmail.com; arc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed; d=zsh.org; s=rsa-20210803; t=1674813722; bh=iuV1zaQGjQ6cMDhyBgbgASnyiFzKfFMYGptSiyBCSog=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:Content-Type:To:Subject:Message-ID:Date:From:MIME-Version: DKIM-Signature:DKIM-Signature; b=JDPTBRayu1NZf/GKXWP8O2GDDDaV7s9NC6KlWBzHi457G+raL9Ue+dDr5Y6BvO2/bnoNUfMmg8 l+ilnNFmzkAa7ldiUR9NbceJBAK67iOBs5XbS/ahI9bKkSzKgZNqI8TvdE2dyFLcUwLB1eru4C OqgtXjs2utgus4UyVOihodciVxelqK8G1c0ugw7ZAtEJnDT27WtrKwvmiuFg9a8bdtggOH5WcM WVrEgjubBQCMAFMqJ81SBuVsN3gG7IK6P+cRh+y/xb1olhdpOHvSTDsvnnaDKjjeiGZ5961zBs 65CA7SMQAA3kXTWfDSOLCUoMxtzdUajYVUU7zThSL+Pd3w==; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=zsh.org; s=rsa-20210803; h=List-Archive:List-Owner:List-Post:List-Unsubscribe: List-Subscribe:List-Help:List-Id:Sender:Content-Type:To:Subject:Message-ID: Date:From:MIME-Version:Reply-To:Cc:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References; bh=SRwbI9V3MBl74yU5D00ujmInSXRv/oqA9Q03uUOLIzQ=; b=pTNNcVv550w2rd4pKA3mBUYpnc NO1ujHtwnCLe57KCopaLYAu3zPYkOOGAgX7cvve4O+qxPaZRdVyslwbI+w4jzUpKdmOgllYQedbNS haho2v4BE0Bol7TTCKcSaLvjiX1vaKAvimwW/NzYSfUFW+JY79PPuifsQe6/nDLcYNbg7MXBcYCqL h1GTASp38e480DUgg2TXEa6bUsKYMVowg50axqzxxjO5i4vs6w6/glb1/BtsG0o+24t+ChKHYZyUQ zmmPsyrYsiurXd8NijxsFATPrJYpZ5ooxy1Uwmaj/pbnCMuVrrYr4IyupPwPeOW92i6qu6bznDqPh FEW3EfGA==; Received: by zero.zsh.org with local id 1pLLYX-0007W4-Cl; Fri, 27 Jan 2023 10:02:01 +0000 Authentication-Results: zsh.org; iprev=pass (mail-lf1-f54.google.com) smtp.remote-ip=209.85.167.54; dkim=pass header.d=gmail.com header.s=20210112 header.a=rsa-sha256; dmarc=pass header.from=gmail.com; arc=none Received: from mail-lf1-f54.google.com ([209.85.167.54]:36612) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_128_GCM_SHA256:128) id 1pLLYE-0007Cg-Vu; Fri, 27 Jan 2023 10:01:44 +0000 Received: by mail-lf1-f54.google.com with SMTP id j17so7383192lfr.3 for ; Fri, 27 Jan 2023 02:01:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=to:subject:message-id:date:from:mime-version:from:to:cc:subject :date:message-id:reply-to; bh=SRwbI9V3MBl74yU5D00ujmInSXRv/oqA9Q03uUOLIzQ=; b=Ze3lT/v3CUOH8GL/8qd49SQQ3Q9kLUgJQQqsO5cWxUql6gvkC07vf5QvXcJq6JxihA C3gTdWXaOq5oprYtHKXYGMW5yudXhiADRT9/HD2/dVvHk5vFVbTKDcE7iQ2ubtyWxaRK R6xrCY0yo6R9eWVRhm5IqJts5Ew2ubEV7gjVEj5G84hV8R3aV5xCQALrVZBlwRFzP9Lq YLFZbp+cQ746m4R4jZakDE8/2ZjE2yA5Ql0XXvm3IXDpv9FYLCxCBEya/vjQRgyNo+gF xA+5laL9vLU4jDE8IH7iuURBlc+dMWBIKdCutdBRac9f+9y00VePO451xrkpN43aCMaO 1xog== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=to:subject:message-id:date:from:mime-version:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=SRwbI9V3MBl74yU5D00ujmInSXRv/oqA9Q03uUOLIzQ=; b=mv1OEJMCdJPEgq2hNpTyq3JHger4S9g/ShNm4A33y3TuRp5ndqb7eqjcz6NV1qj2/H XkeJRAaBdvF15e3dwPRMvkby+hsULscICFIyTcJB1kV+HKgo34p1OKmFf5XOMK6rweHN DHoYGhHvfGFqPQzSqiRtEGE8AuJuElRVc1qDWAPhOhWNrBC+hRCoayc82oLejEsN6puE 4IP7zkdtR1bS1xwFG5l4qCdlWZV5yw3hDJiq19F40FOYDIj8Q2RW0E7qI2oylAPBqyrM g0T45817zuHpnGSWVXRYpBrbd3uqbUFws05AfrzGUCVnA4uMuNfPNvZv528JF/GY0rrv 3uwQ== X-Gm-Message-State: AO0yUKWrdbrnh8Ol8NkYCagnTC8OGgVD2X8bY4iKk8taLWMWOiQJ/U50 KXStTGH5Qov7PmNlFEXe+izqlbUhKAR1O6dpjmpstwMd X-Google-Smtp-Source: AK7set/0uBb6n2gbAGmh8xMcZX93QjQkSYcvfvifD1WmiSX1MNxom9yMb4zFweWxLYrA32hR0DPSxDGFQPK9bWAK2dI= X-Received: by 2002:ac2:4841:0:b0:4d7:bda4:e6af with SMTP id 1-20020ac24841000000b004d7bda4e6afmr1046138lfy.184.1674813701962; Fri, 27 Jan 2023 02:01:41 -0800 (PST) MIME-Version: 1.0 From: Sebastian Gniazdowski Date: Fri, 27 Jan 2023 10:01:15 +0000 Message-ID: Subject: Pattern engine extension for \< and \> support? To: Zsh hackers list Content-Type: multipart/alternative; boundary="000000000000c5403505f33bf361" X-Seq: 51332 Archived-At: X-Loop: zsh-workers@zsh.org Errors-To: zsh-workers-owner@zsh.org Precedence: list Precedence: bulk Sender: zsh-workers-request@zsh.org X-no-archive: yes List-Id: List-Help: , List-Subscribe: , List-Unsubscribe: , List-Post: List-Owner: List-Archive: --000000000000c5403505f33bf361 Content-Type: text/plain; charset="UTF-8" Hi, in regexps, there are \<, \> and also \b sequences, that match zero-length string on the word boundary. They are particularly useful for e.g.: refactoring substitutions, like e.g.: with sed: sed -r -i -e 's/\/other/' This automatically protects pre/suffixed strings like str_myvar and myvar_str. In mcedit, I often use \b that's available there (\< and \> do not work), to obtain the same effect with the regex: \bmyvat\b I'm not sure if distinction of left and right boundary offered by \<, \> actually makes a difference. Zsh has similar sequences already - (#s) and (#e). They do match 0=length strings on begin or end of the matched string. So maybe the topic is known to any implementing person? Is it hard to add such \b or \<,\> sequences? Could it be also possible to make it backward-safe, i.e. the sequence be ignored by proceeding Zsh versions? -- Best regards, Sebastian Gniazdowski --000000000000c5403505f33bf361 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hi,
in regexps, there are \<, \> and also \b sequen= ces, that match zero-length string on the word boundary. They are particula= rly useful for e.g.: refactoring substitutions, like e.g.: with sed:
<= div class=3D"gmail_default" style=3D"font-family:times new roman,serif">
sed -r -i -e 's/\<myvar\>/other/'

This automa= tically protects pre/suffixed strings like str_myvar and myvar_str. In mced= it, I often use \b that's available there (\< and \> do not work)= , to obtain the same effect with the regex:

\bmyvat\b

I'm not sure if distinction of left and right boundary offered by \<= ;, \> actually makes a difference.

Zsh has similar sequences = already - (#s) and (#e). They do match 0=3Dlength strings on begin or end o= f the matched string. So maybe the topic is known to any implementing perso= n? Is it hard to add such \b or \<,\> sequences? Could it be also pos= sible to make it backward-safe, i.e. the sequence be ignored by proceeding = Zsh versions?




--
Best regards,
Sebastian Gniazdowski

--000000000000c5403505f33bf361--