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 autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 19982 invoked from network); 1 Aug 2023 13:31:10 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 1 Aug 2023 13:31:10 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20210803; t=1690896670; b=WE0Rb57HLaUzhXsQkr6FiEjG3jgzmu1ZjmCxDuCtuR/4Wjp6JEqlI8t51mVJZyPncoND9xS0C5 YRd21ulC8LE3mlulLeIz+dBJTerVBa4WnU5RcRjf1Sg02q2KYpIbcqsn8lqgR12a6jG+HFqv1X H23kHFJvAj/6ECI1TZi5JTVFzQdMFCxlqVIOT+P9dML6aHnAQWtXrzV/XrLlnNK37NN9krslVC mZQA0gYhnsNIKpHH2TtTkLUlt33rbhGllsfPBmLERvveefW2E+09uWQuofo19lHZM2JMFohp0+ rqBo/43CHa2PzLSI9pDrMs0/eV9HcM2c2KoVSvLyZHf0og==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (csmtpq1-prd-nl1-vmo.edge.unified.services) smtp.remote-ip=84.116.50.35; 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=1690896670; bh=iPcLtq4XMLnsIEJJosL7k+OL9BVW9IceeH+G1Wpp8t4=; 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=sev+wALNKMwFq3+O0SGPeZAUr8MHAA0Pw3y7qTahFIBDCGwSJ9a6tIGZGR34Mm0EyWBjzi1QOI C2U21ZQKns1Ak4ijULfxDtJHdYVP4y3lhH1vyBDS9Poe1n4G0ZnC1wXgXyJn2Gh5AKuly6or6C YyBE2qKzjsN9SA38hgSo0mWhuVf/SIRiVonUwC6QPX62PoR0/F2tA8NtDOg8R3r1JaF87WcLP2 g3LJEpwXHbJGzP9jkhLWU+a17OVEAKg/bUn6eZQYUUookPHzKMcjak/n3kPir/fwMJUmLjCndJ 6HEPuOnWOPsxX+erUzbqNWluA17MRf4V87FuOdNft43Emw==; 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=6Blg9OjzpNf8oqNYcLMSNRs9RQdTHRJAMMOeOAzQrjU=; b=kxB2k7WCOiDcBIjtuZDlbwjwAr ezpcnQ58BdJfdp8hDKCYVLbrwDaYT9zmjvcK2MK2IXM11jlgg2hWajR+zJwOpb1CwtqVE1l1lgQm4 9S3UG1cI+yrDkRt8lFRnYZ/BRpUJKgcZfU8GJAEKLRq7A2v24Ces8XGSzWi8om6Ujs8hxbIfgaD4p uxMZrzUiihZ9LX4EGWhSOl881SpTgU1j640OIPLi7cL0VPjUhSPtzfdQsuAfnqwYh6TUQAPAwlFVL sKpxjh4mXvmX7XZ6yqr/UfSyCXzUmW8/f+k/TaQi8D9u0CUmhgHk0tflrvb/VqYqhjYOnUrnQd5BZ O/eSbsLQ==; Received: by zero.zsh.org with local id 1qQpSv-000KBq-Qy; Tue, 01 Aug 2023 13:31:09 +0000 Authentication-Results: zsh.org; iprev=pass (csmtpq1-prd-nl1-vmo.edge.unified.services) smtp.remote-ip=84.116.50.35; dkim=pass header.d=ntlworld.com header.s=meg.feb2017 header.a=rsa-sha256; dmarc=pass header.from=ntlworld.com; arc=none Received: from csmtpq1-prd-nl1-vmo.edge.unified.services ([84.116.50.35]:34705) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_256_GCM_SHA384:256) id 1qQpSh-000JsY-Tx; Tue, 01 Aug 2023 13:30:57 +0000 Received: from oxsmtp1-prd-nl1-vmo.nl1.unified.services ([100.107.83.138]) by csmtpq1-prd-nl1-vmo.edge.unified.services with esmtp (Exim 4.93) (envelope-from ) id 1qQpSg-00FP90-RF for zsh-workers@zsh.org; Tue, 01 Aug 2023 15:30:54 +0200 Received: from oxbe7-prd-nl1-vmo.nl1.unified.services ([100.107.83.73]) by oxsmtp1-prd-nl1-vmo.nl1.unified.services with ESMTP id QpSgqHzHgIFfSQpSgqbvUK; Tue, 01 Aug 2023 15:30:54 +0200 X-Env-Mailfrom: p.w.stephenson@ntlworld.com X-Env-Rcptto: zsh-workers@zsh.org X-SourceIP: 100.107.83.73 X-CNFS-Analysis: v=2.4 cv=Xrc8e3J9 c=1 sm=1 tr=0 ts=64c9090e cx=a_exe a=jnKRRUzikw9eUPzUDcVRDw==:117 a=IvlwODmuRu4A:10 a=IkcTkHD0fZMA:10 a=dGsWvjqBAAAA:8 a=SNARGIqk0Y0N5I-EYN0A:9 a=QEXdDO2ut3YA:10 a=HbQOABYz3jhqdZF7JfnK:22 a=EwAE0RQWx3bH85eTCWcH:22 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=1690896654; bh=iPcLtq4XMLnsIEJJosL7k+OL9BVW9IceeH+G1Wpp8t4=; h=Date:From:To:In-Reply-To:References:Subject; b=qqatzpN72n4erq36sp90ubo306kgx8A5trdaAC9ZyIIb46hTXZnhoNYYGVVMAEW8v sdTC9Q6g6hrvTLv+LOcFAbat0NMlZZNSUz25z6uI0/t5ByF52AEsc6D/KzgtL4MPYb mpnRuzsxB5UqJreJiRTSkq48pm1qLAcJe+dR+SV1+/uQpYSElxiB57yV+MhQ9Ju5XL tkoUXqLEkDMtlEev2EJTgNLUM/vDTkGpEe9O/GFM2k3hCvNcBxUoJ5ndCFUUnt6lMI ujsTUeZSJfTMcayU3xgVMlDp5izxWwfgORnybC4JcIMl97jbwiRWHNLqN/pxUMThZF u6xqphdYKzXjQ== Date: Tue, 1 Aug 2023 14:30:54 +0100 (BST) From: Peter Stephenson To: Johan Grande , zsh-workers@zsh.org Message-ID: <2034111748.1610065.1690896654728@mail.virginmedia.com> In-Reply-To: <16673694-5299-cf1c-8553-c3d703d942d0@crans.org> References: <599e3c13-53a5-1823-6d0d-68dd722967d9@crans.org> <8c33aa3a-fde5-45ce-8f22-c817c6fa4a9a@crans.org> <20230728064106.ufcfaqondhn3wge7@chazelas.org> <16673694-5299-cf1c-8553-c3d703d942d0@crans.org> Subject: Re: Pattern bug on (a*|)~^(*b) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Priority: 3 Importance: Normal X-Mailer: Open-Xchange Mailer X-Originating-IP: 147.161.224.196 X-Originating-Client: open-xchange-appsuite X-CMAE-Envelope: MS4xfCSE36YPew0t+NiienPJCM4nl8cWSsAWYtgTm6ngUOFqAINtjEPCcLJoU8iOpdy14MxtAv/MPZPu0081U8QbDqP7DIMWpRjwUamwNRbqNG1u+08vGjri y3e9l886saCLnSe7ptfWOFDwj7+wkmoMg04R1rtsKl4niZC9YMWxA+JMYmAh/LWGaRece0o6LcDeAKaGLSthjEJ6P6CYeeoe5JXvpFKeftFgEFJZ5E5Xg9xD i/ml2Ui7WQDviKNa4QXIOA== X-Seq: 52010 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 01/08/2023 14:19 Johan Grande wrote: > So I'm thinking I could filter for user-provided patterns that contain > '|' and don't put them in the mega-pattern but filter for them > post-globbing. Does that sound like a sound solution to you? Yes, I think that would be OK. The only case I definitely know of where you'd hit the problem would be branches using that specific syntax. I'm not entirely sure if you'd get issues with approximation, which is even more complicated, but so long as there are no (#a...)'s in your patterns that's not a problem. If you can guarantee that the first branch is a longer match than the second, you'll also get a away with it. So (a*|) will work, because the first branch must be at least 1 character, and the second can't have any. Obviously, that's harder to check for automatically, though, but you could do a limited check, say, that any | was followed by a right parenthesis. pws