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,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED, T_SCC_BODY_TEXT_LINE,UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 31962 invoked from network); 4 Jul 2022 13:53:04 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 4 Jul 2022 13:53:04 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20210803; t=1656942784; b=V0Y/3fNaWtitqPqmxuVgjqxQUf1GVRf5U1DfOxJAvit3EMQX6tWmrmddEGsgvTGnkRm/Sre+mU Kc7sV+4ufYZuigiGnDUr47znmBmXqrQvzyKXG2Y1vHuYQ60oRNmWJX1k2NuoOa7moL7C3Tdyjy zmqyOVegVVWA6SNXEaYIiGq51bEEKi6GrQTnXk+/Esz+J+hXjg+K6QqVw5PUfKbg0JYS1L/zSC oSGy9mXq4Qkfq9kv4Ov0IklGqvAEMieAeZvdH3cnAs38M2F3rQHSNfF4523cVqlgmsgeSuq9Z0 RXFIH9XyicNHkMbZiUDMBGe3GEXR9PXJ8ZLgeioDGuFpFA==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (smtpq2.tb.ukmail.iss.as9143.net) smtp.remote-ip=212.54.57.97; dkim=pass header.d=ntlworld.com header.s=meg.feb2017 header.a=rsa-sha256; dmarc=pass header.from=ntlworld.com; arc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed; d=zsh.org; s=rsa-20210803; t=1656942784; bh=d6F7zRCdnZ419BqVv3GgzcsIda8YqgnNuu2YJCO6xgA=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject: References:In-Reply-To:Message-ID:To:From:Date:DKIM-Signature: DKIM-Signature; b=G7d/qLzuB89qzh5YoARTf/uh0zitZjRFBw9sL4G8r8wdoqm1WXDNgKM8y3aZvjNm7HVWymBJwy zYrmfcdklFppuZhcXNJbwcPZv64TsDoD5ODMDILLv/ec41DWwbMGeQG19S4lq+NA8ppP/MidB1 SaA4lJqQMRHlHijCjmGpFP6zfr1jqDZEtJUir2y7QQl92txTy6faowGrDq6mcbHd8dRkaTMXIN ywOtaH/XTeBu1sTZaDxspzA5astn5Dl2JaPGgAEDmsviu2+xVqUeMCbvMFsHlg5S2z6Mj2qcUw QvbTh6hxp/vW+v94bTZDLfAsOaOV/4v6v3cJRqo31/8W2A==; 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-Transfer-Encoding: Content-Type:MIME-Version:Subject:References:In-Reply-To:Message-ID:To:From: Date:Reply-To:Cc:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID; bh=obOxOUFk1QFbUo0EUjuncqeZktL580jz/Gp7x27gxgA=; b=eCNDHbvRkJQAw8g3GNeeE3Lgwt G69zU/lr3QN3SmODd4EZsJnfLXjBzl0wYdmtPnO0pQpIwiLUWfUNgzeLGK792ovJLw01MWCShvotu VbuoR1sxp0KTvqO6ew38HwNOhEivjtJIUbOUoaYKwn6EhH/mDHC1TBK0bLIe0b6CoN3C/ySp7iRs9 /GmY1PrYVMynmQxXdUSSVMAM+EyySreq57gtQSYpaM/rNQ5Z3sbCxwtEdQbGHI8Q4TnrAzQEXTKPa 0AsW9mmlv08x+DYTg2YDEA1LEg8U+tEevAmJolU73k9CBjbMuwjuxOZBcUTOaeHP1an+ngWrBMBu/ 4r9lqPpQ==; Received: from authenticated user by zero.zsh.org with local id 1o8MVb-000BH0-9G; Mon, 04 Jul 2022 13:53:03 +0000 Authentication-Results: zsh.org; iprev=pass (smtpq2.tb.ukmail.iss.as9143.net) smtp.remote-ip=212.54.57.97; dkim=pass header.d=ntlworld.com header.s=meg.feb2017 header.a=rsa-sha256; dmarc=pass header.from=ntlworld.com; arc=none Received: from smtpq2.tb.ukmail.iss.as9143.net ([212.54.57.97]:44204) by zero.zsh.org with esmtps (TLS1.2:ECDHE-RSA-AES256-GCM-SHA384:256) id 1o8MQO-000Apa-HO; Mon, 04 Jul 2022 13:47:45 +0000 Received: from [212.54.57.82] (helo=smtp3.tb.ukmail.iss.as9143.net) by smtpq2.tb.ukmail.iss.as9143.net with esmtp (Exim 4.90_1) (envelope-from ) id 1o8MQN-0005UC-K3 for zsh-workers@zsh.org; Mon, 04 Jul 2022 15:47:39 +0200 Received: from oxbe6.tb.ukmail.iss.as9143.net ([172.25.160.137]) by smtp3.tb.ukmail.iss.as9143.net with ESMTP id 8MQNoJJBSsyQZ8MQNoqpTF; Mon, 04 Jul 2022 15:47:39 +0200 X-Env-Mailfrom: p.w.stephenson@ntlworld.com X-Env-Rcptto: zsh-workers@zsh.org X-SourceIP: 172.25.160.137 X-CNFS-Analysis: v=2.4 cv=W/8r6Dak c=1 sm=1 tr=0 ts=62c2ef7b cx=a_exe a=wOjQ4in9RKFG6jhXMc4Ghg==:117 a=1DWFKdCB1IcA:10 a=IkcTkHD0fZMA:10 a=ZjyAdWuDOD4A:10 a=pGLkceISAAAA:8 a=YBETe0K4Ki8FRGTsU1kA:9 a=QEXdDO2ut3YA:10 X-Authenticated-Sender: p.w.stephenson@ntlworld.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ntlworld.com; s=meg.feb2017; t=1656942459; bh=d6F7zRCdnZ419BqVv3GgzcsIda8YqgnNuu2YJCO6xgA=; h=Date:From:To:In-Reply-To:References:Subject; b=L0/euXZBQ3TwgP0domv+rzurmS+pLRWJ0GeVV0sFC6/otsZxl1JzA84Mg8qIJ+3Pc 3tEHPTlTz4ab/rn5HKvjO3JNuVUBkpsFZhT8W8TumA75ra/iNDzdFGftO97uMT/MPi pgmDb8/pB8JlDIjC+/q9xYVFv+vI2VTWjyKJvTSVZpvhNhMCi0bV/DbKVafnw8nhfv IL7kuZaq3hX/Ri0uMInDwuRCs211fSBo0fY4adzAIcH7zPGQPo00ulh2TeRXuYcM+R E/TrB12VDDKxFXfHtajGJIeBEXjS7QRtZFSuXufxDh7zrLCdn9jsOPCzeyqoyNtHo7 XGdk4CucaW8rQ== Date: Mon, 4 Jul 2022 14:47:39 +0100 (BST) From: Peter Stephenson To: Zsh hackers list Message-ID: <76883431.1281129.1656942459330@mail2.virginmedia.com> In-Reply-To: References: Subject: Re: Extending regexes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Priority: 3 Importance: Medium X-Mailer: Open-Xchange Mailer v7.8.4-Rev72 X-Originating-IP: 147.161.224.167 X-Originating-Client: open-xchange-appsuite X-CMAE-Envelope: MS4xfITknaE98GBE+qFIlPu1pHphByAhKgkpmwk6GnEYhuKYv6rxgYGHENySwC/O3z/SsuMvIaAXPZSPmuFvXS+5Bl5kU//H5dZRvGawF05CzCdnUAZIfEeW CGsCpSOUG0uT/yXLKohfUzOJfAnxJpURTAIQRr5WDEop0kOVQ2B5VGvDkYYrben8FtxkGhJ7OsFMJxKzHe1avLbLxDMWL0E1jP0erkLE3YpdVTEJ23imslvc X-Seq: 50401 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: > On 04 July 2022 at 13:03 Sebastian Gniazdowski wrote: > Hi, > Zsh has extensions to regular regexes - the ~ and ^ negations. > > Therefore I thought that it's weird that such an useful feature is missing > from the commonly used regex syntax. So maybe an attempt of updating it has > sense? You're quite right both that they're very useful in zsh and there's nothing like this in normal regular expressions, but unfortunately I've got a strong feeling this is a big can of worms [hope that image is graphic enough that I don't need to explain the phrase for non-native English speakers]. I say that as although I'm not very up on the mathematics of regular expressions I did write the basics of the current zsh implementation of glob negations. (Before that, there was an even less efficient implementation that created a structure for each part of the pattern, which wasn't good for memory management --- this is going back to the 1990s, I think.) There are some pretty pathological details to make sure this works in every case, so I'd really want a real expert in the subject area to think about this before it got much further. pws