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.5 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,MAILING_LIST_MULTI,NICE_REPLY_A,RCVD_IN_DNSWL_MED, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 20478 invoked from network); 1 Aug 2023 13:46:22 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 1 Aug 2023 13:46:22 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20210803; t=1690897582; b=hDfs8bD7sw9YlFxU9z+DTHgQJZ2p/jpQlFDaIhGquLj82bgP7+650E+cutPi8ZCLVoiCt4chjo /7JOu6j08AnQmu5Y2Of0XM3hqp48PBw+KQazFrdeoifsW0vaes1f4mkLFhid5fNiDfFWxf3QD0 Y8kof7aOOzDAHiHNfJq5qdTlccoLWBMgRlYCe2NZ//89HG4VRyftLRbhmY3lFczjmRUU0kjf6k k5JblqUuHnJlQ4oXITkf7zpGSJ/xxutyJWn2MfrOquCoVShwOJ3kFTw7iUDzOJSBgPGf/22j/s 0Tm+j99XMWJraEZRBv0hv8eut+SwyMCVCb5eDRchGrdt8A==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (redisdead.crans.org) smtp.remote-ip=185.230.79.39; dkim=pass header.d=crans.org header.s=mail header.a=rsa-sha256; dmarc=none header.from=crans.org; arc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed; d=zsh.org; s=rsa-20210803; t=1690897582; bh=efL23OLmBFink5NV53im7JiQgFIuKJWVMeUAo5EzfL8=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:Content-Transfer-Encoding:Content-Type:In-Reply-To:From: References:To:Subject:MIME-Version:Date:Message-ID:DKIM-Signature: DKIM-Signature; b=d1aEXv0drLc6wkIjMb/U8u+xIDgaGDYVUce9gfAsIvaHBTxHjfzH/LZtwgruIyxLEFRSDSM+0i mMm7Cv93DzBkez/guC/bJyA8IOqNayeGqGNNFuOHA3S8lRB/5q6mPjmfCZPiW7zr1w9nTfKxqU wSMhc2Mb6XEKBx8a73UJdjZI+boQHLsjsVQnFcofIYdv8rJjtyETir99yWVirTQmNji1itiAY6 QnXFvVmCWpF23zhUuCU6iDgZvDpwfub8BG5vFj8HxVnNWuxYbNk+YAz2pmq0PyPssrSDW9uVC9 yfFWuA7uO6ZYvJzw7acbQg9KV1VboQhObg7rJWV2xl32tg==; 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:In-Reply-To:From:References:To:Subject:MIME-Version:Date: Message-ID:Reply-To:Cc:Content-ID:Content-Description:Resent-Date:Resent-From :Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID; bh=4EyYxcF4FQo5AmN8xOSk6osND+/BkvczH0MK2O/DiOY=; b=hjJ/xQePMyLA52M90r8rWJaxow X0WTn9QKLC+nAOpld7pqiwZAtqJ6wrBFUxydRiY7qJNPKkyXYCGwtvC6JQ6FAqghquKk9SoER+MOg nQReSJe9OcC4ZDQz2WoLPvJiZtyLSPkmaH3ZrLtaU5anxIPfQImen/BqU4MfnyK4+hqt3bnBDiw9r I0N9mtKb7xxjAMBwWambmNxT7MXLQD3PplCujyHmd4UEPn77QQkrA+WoCHKGN8fqef6gb7ziuEjMr 7jVnFjiP0EI4nvOqcVLAqf1teZQoiQsrl6LO06YruRHfyRQLdYwEtnFpgQU9Hdrw1g9fi9RbCyqjz fH7QFCTw==; Received: by zero.zsh.org with local id 1qQphd-000L6R-Nq; Tue, 01 Aug 2023 13:46:21 +0000 Authentication-Results: zsh.org; iprev=pass (redisdead.crans.org) smtp.remote-ip=185.230.79.39; dkim=pass header.d=crans.org header.s=mail header.a=rsa-sha256; dmarc=none header.from=crans.org; arc=none Received: from redisdead.crans.org ([185.230.79.39]:42040) (DNSSEC AD) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_256_GCM_SHA384:256) id 1qQphP-000KoG-F0; Tue, 01 Aug 2023 13:46:08 +0000 Received: from [IPV6:2a01:e0a:1aa:1110:f148:d617:42f2:4e43] (unknown [IPv6:2a01:e0a:1aa:1110:f148:d617:42f2:4e43]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by redisdead.crans.org (Postfix) with ESMTPSA id B4B7D173F; Tue, 1 Aug 2023 15:46:08 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=crans.org; s=mail; t=1690897568; bh=efL23OLmBFink5NV53im7JiQgFIuKJWVMeUAo5EzfL8=; h=Date:Subject:To:References:From:In-Reply-To:From; b=q/X+6LRwGIph5aix4EKtFkUP7kv0he+uLiCvL/TbhBlwXGSSVF+m/hgAYy5/wD/3s DO+LnGQ6zJj75nia0HPmLiXTEqo5eLqNA96ZeNO2yM+XU6jHHA2VKNmO2fk7Qbsrea Ri2ZpRhSbf3i69+aZ+Z22yM46Y480yPzN/YMYDAYa2hBIPNiv1SJFNGiQr3zNjykeB B90qmgbkpOiBUtI65rSVSf7hGHaT2SGshzPNTRc8qKlh4t2cn25vbahKbynWRY/nGl m8vZxHsVBz47hlkcUiY8dIswAXFiu8JKk0HsF0iA1Wpfx1JhmyxtG3yW8JMK+J7L4/ ax/DOJ93NPcxWfa+bnG2eZ/ZrK+iHqAODxuL1kERVQr6/ktnXHT2ahXtpCzw/glNbG 7SUSejb4L5XNm4wcxen1vODsRWJb9YX+/OZDKaOJb2d9qO6uaLiJnljpDZgpaUjXY5 Ehr4MQeAdaqVpwuIVQqAme9pVAQD5mk3Q/4+7ZcNmMEsnoylCM09tszM6fSR4CQm8+ k8a9vlycCtZje/EvzmVUnTKGc37hsSphSBHLpKKSV+7/P2BllvoZdc75nIknpBq5Pu aed7VSBFKt61QTlNfREbCbYeeYT6zR0nALeTGHvHMMXhI22HNK48eNcZN/WKxxFUBL zvz2WZ36gqt+6qzGTEjXQ2q0= Message-ID: Date: Tue, 1 Aug 2023 15:46:06 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.13.1 Subject: Re: Pattern bug on (a*|)~^(*b) Content-Language: en-US, en-AU, fr To: Peter Stephenson , zsh-workers@zsh.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> <2034111748.1610065.1690896654728@mail.virginmedia.com> From: Johan Grande In-Reply-To: <2034111748.1610065.1690896654728@mail.virginmedia.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Seq: 52011 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: Le 01/08/2023 à 15:30, Peter Stephenson a écrit : > 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. Understood, thank you. -- Johan