From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2668 invoked by alias); 25 Feb 2017 21:05:45 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 40639 Received: (qmail 4491 invoked from network); 25 Feb 2017 21:05:45 -0000 X-Qmail-Scanner-Diagnostics: from park01.gkg.net by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.99.2/21882. spamassassin: 3.4.1. Clear:RC:0(205.235.26.22):SA:0(0.5/5.0):. Processed in 1.041458 secs); 25 Feb 2017 21:05:45 -0000 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=0.5 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_SORBS_SPAM,RP_MATCHES_RCVD,T_DKIM_INVALID autolearn=no autolearn_force=no version=3.4.1 X-Envelope-From: SRS0=di5J=2G=brasslantern.com=schaefer@bounces.park01.gkg.net X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | Received-SPF: none (ns1.primenet.com.au: domain at bounces.park01.gkg.net does not designate permitted sender hosts) X-Virus-Scanned: by amavisd-new at gkg.net Authentication-Results: amavisd4.gkg.net (amavisd-new); dkim=pass (2048-bit key) header.d=brasslantern-com.20150623.gappssmtp.com X-Greylist: from auto-whitelisted by SQLgrey-1.8.0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brasslantern-com.20150623.gappssmtp.com; s=20150623; h=from:message-id:date:in-reply-to:comments:references:to:subject :mime-version; bh=sGHzwx336+cmwAwKSQ4HWUTKFCLLeoeALOZ0nerYH88=; b=Hsy5gTIZDICWqXa2aalb9WeMvIPfdGK0gChaB1l+i339Ug1ed1UF8jI4fF7lPOoVQL iXF9Qe26kvzz4UuMqDs4kiFZyqLLuD0uXgiUinWDIKK9sQbQDUWweINWS/cDsddNLmcv N4XzoRAtHu5u/OLhYOMajmPFTX807mnuMyQuTbTT6e4XEIF4SeNf0uZBdREQ2NQGipJl Wqmr9UhOP3Oo/WML4rzrgS+RFnKBHnljr6DpeOMmRKcHccJjJS8qv/VBkNX4g+SCOxXk jOUpbxDUwPcdfMtYHJu9V3CYTMPzSPrU86aHn1VKoWjGPVsCASo58OcYjJz26hSDFwOv CyhQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:message-id:date:in-reply-to:comments :references:to:subject:mime-version; bh=sGHzwx336+cmwAwKSQ4HWUTKFCLLeoeALOZ0nerYH88=; b=d5QJ+UZ/gS3g0dqIKB5tZufVzwOJTtNCzAAQFJ6QEIG6rCZ/4dzmBt3KTs+3ptwnpI m6C5N3bYpIMUBrtAZZznM3g8n/RKMHEtnfQCq9LCn3IHacB3JoxOaF5EiVLnqplOoUVk ITjLmQzBqXHqemNC3U8o3tgB+64Z5Ch5wCw+E9vvAXrbZCjUGm3qlPUke/dNp4eIwGBQ FtkdTwPMW5kFKmLEtuCJ5kGtp8tqzF7zClSWDlgz06YxONUh9W4S5+JVPO6taQyHeO4z ra7eh8D/GIDXJx8wJ2Qzc5Cpt7k7tUx4nQdPUirJ5SZH6pMVsXmRCl/zkznvkITne4Xk tdcQ== X-Gm-Message-State: AMke39nJxl7Ast8279CPKLMWtZv86/vlHz2P2XNOC/LWM1h2JWEPBXffR3UkS3JT8HHMzQ== X-Received: by 10.31.65.17 with SMTP id o17mr1351267vka.33.1488056716989; Sat, 25 Feb 2017 13:05:16 -0800 (PST) From: Bart Schaefer Message-Id: <170225130525.ZM22939@torch.brasslantern.com> Date: Sat, 25 Feb 2017 13:05:25 -0800 In-Reply-To: <1488045262.2349123.892698344.1068648E@webmail.messagingengine.com> Comments: In reply to Sebastian Gniazdowski "Re: Feature request (#b)...(...)" (Feb 25, 9:54am) References: <1488011830.2241447.892433784.52D183B6@webmail.messagingengine.com> <20170225151315.GA4424@fujitsu.shahaf.local2> <1488037019.2320483.892622496.169D8730@webmail.messagingengine.com> <170225084736.ZM22286@torch.brasslantern.com> <1488045262.2349123.892698344.1068648E@webmail.messagingengine.com> X-Mailer: OpenZMail Classic (0.9.2 24April2005) To: zsh-workers@zsh.org Subject: Re: Feature request (#b)...(...) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii On Feb 25, 9:54am, Sebastian Gniazdowski wrote: } } ${a//(#b)ab(|c)/x} "<- last one shows | isn't greedy" } x x xc <- last one shows | isn't greedy Yes, you're correct. Putting the shorter (in this case empty) alternate first in the parens makes that particular subexpression non-greedy. This was a deliberate choice -- though I can't find that it's been documented anywhere, on a brief search. } I'm not sure if regexes work this way.. Maybe I'm loosing it for a } moment, but: } } [[ abc =~ ab(|c) ]] && echo "I've tried multiple options" } zsh: failed to compile regex: empty (sub)expression Yes, that's also correct. Zsh patterns are not regexes and the default regex library doesn't allow that syntax. I believe you can use that syntax if you load the zsh/pcre module and setopt REMATCH_PCRE.