From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6850 invoked by alias); 8 Mar 2016 02:52:35 -0000 Mailing-List: contact zsh-users-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Users List List-Post: List-Help: X-Seq: 21374 Received: (qmail 6684 invoked from network); 8 Mar 2016 02:52:34 -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=-1.9 required=5.0 tests=BAYES_00,T_DKIM_INVALID autolearn=ham autolearn_force=no version=3.4.1 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=fsajT1fjMmiEPLXZv3W2eOMxziJsrpyEkvF8qZBznzc=; b=swWlm3lNgoJLPsrS5xdNXLM+mMqLtQdMraTwKEcduKjeKFil4dP+ZAOgSaRX4r0+08 4rOYkDzDDnmy4TkzDK6urTXF8LOBatelMo+OCrRyWadLD22/w+kaZzrHgwMg3xKdtI3j b2gohrGhh/YjmVnwsrBLqde+Nr+4akyohkRagWaOZtlMy2IS9LzCRwzuwGamYJ9No0V7 zbfjFAoPW2FtGjFNvLwvAuw2GzH1qG1KE2SiAyjBf9GuKqyUVBAXLICdVHjbR3Dpkpd6 fRMLY+qmgtI9i7HiYThhtrqDT/Ijo/Yrm+iqGx0P6L4tPunoZONv3Ua9Fl6ik6ah4sG0 +TuQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:message-id:date:in-reply-to:comments :references:to:subject:mime-version; bh=fsajT1fjMmiEPLXZv3W2eOMxziJsrpyEkvF8qZBznzc=; b=YZq1Cunoxgdlnv57WVN2GK0n66ZBL3pB9EFWfwoBnViOhR3wWMuA9p9zBkQYmQeVZs vLm7l00UEwipZ8n3eeVRq9ZX/UeZTm5o1OXjYA5MjRC4dd5uXR/WZSUE28p+uvKgjMyD 0bfAPhYTuQ8ZXZkwgKpOL4779HRo3FUvlF1jHF8BD6WQGrWokW4ydGwMEkaPmE9WP94+ dkhRizTFYZq7iHNa9qIkzbDDSZUalYPzQeftKZLRYLRcepTc9414PvF+ZE/FmT9+2cNL 6Ep4OlUJwqWqfs2kdKFK4itMTDUgVm3DVN54YQdv0lNpU7dOHkz1oeiOOT3eusauupn0 bkpw== X-Gm-Message-State: AD7BkJKnBvN2hVEvdMgRYd4WaC5lpoi4xh598X25NXQRFY7vpnb0ZXkWlDEq59uxeYbrSA== X-Received: by 10.66.193.226 with SMTP id hr2mr38240269pac.20.1457405549768; Mon, 07 Mar 2016 18:52:29 -0800 (PST) From: Bart Schaefer Message-Id: <160307185234.ZM23145@torch.brasslantern.com> Date: Mon, 7 Mar 2016 18:52:34 -0800 In-Reply-To: Comments: In reply to Mikael Magnusson "Re: substitution groups and patterns i replace string (Emacs' \\1 etc.)" (Mar 6, 8:15am) References: <87k2lk2ws9.fsf@debian.uxu> <20160303094140.705eb3bd@pwslap01u.europe.root.pri> <87a8mccfmv.fsf@debian.uxu> X-Mailer: OpenZMail Classic (0.9.2 24April2005) To: Zsh Users Subject: Re: substitution groups and patterns i replace string (Emacs' \\1 etc.) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii On Mar 6, 8:15am, Mikael Magnusson wrote: } } % echo ${a//(#b)([aoeui])/${(U)match[1]}} It's actually quite simple to make $1, $2, ... refer to the values in the $match array during ${v//p/r} substitutions. This would make the syntax look very perl-ish, but would mean you can't combine backrefs with expansions of the normal positional parameters. Anyone interested? Discuss? Incidentally, for a fun time consider replacing ${(U)match[1]} with ${(P)match[1]} in that substitution of Mikael's.