From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8523 invoked by alias); 29 Oct 2015 23:46:41 -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: 37021 Received: (qmail 4764 invoked from network); 29 Oct 2015 23:46:40 -0000 X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) 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.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:content-type; bh=j5obqM85UeAd9gINWlBnaQteq4uvsLsbyiH036QO6AQ=; b=ChZRobvLUvNJ7oBdC6MISo0Ru8rp91wTn68ITUjdx0YChcZyhWNyE27tFtR0cOt/6m 0PNLyq2np+rnWZS8AdjPoBSP4e9q7wzug7OhcwX23uWIizfnyRa3dH21gQSFdFQOWxFv WDoeUcY/6LAZihESEISmTJSd6/Z2Iz9dmJt4Jv2RHClLXF3M0HIR7tbh2+5tEP5VKt4p IFRe/PhdANgozWxxOeOEzbmQzPETwzVWF46yEi8XXp4Ou09slWyRzlWQJw9NTAgZ4qb1 LqU0gX2JUKMnbzPYHTadDaPuZJIojeR1/At7ALlU+xSH9GfGblrVZOJVK4T62ruZzB/w 2uYw== 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:content-type; bh=j5obqM85UeAd9gINWlBnaQteq4uvsLsbyiH036QO6AQ=; b=ABA/L04qieHSbvuF1zECQrmXc2T7rAxmsMiQ6fioIkUQLWZZAeiuChROsCnNqcEuFf 8jXPY0qjCeHSDES+yHkStLRZWxCpXKSikXkE54wMjXuA6cNgprF83n2cy+fIoK97HKU6 aosufEeJx1ShZ9pnz2m94BCtscxyqGThmhPB6qNX7pLNSJSba5AxE5golJxb0KgG3qwE PO792YH7Soj5kBnoqezJlfnxjP07GfOGoGxKPkhGf1dwvv3iqucN5Bus85MfdYAZgAXc qMqJdonGgEwGhm1dL2XYBR2ZKA6Et5NykN95xWOVu74VFaVBqfxZIsz3dnHswaTl4DZE AHKg== X-Gm-Message-State: ALoCoQnWVjFee+VsCZ0Trrx2DG/z7LH25kGi0uC9mK7HxHapjEN/RsXZHbZlLIkTEGni9xjvIIdx X-Received: by 10.182.134.170 with SMTP id pl10mr3603889obb.42.1446162398265; Thu, 29 Oct 2015 16:46:38 -0700 (PDT) From: Bart Schaefer Message-Id: <151029164635.ZM18026@torch.brasslantern.com> Date: Thu, 29 Oct 2015 16:46:35 -0700 In-Reply-To: <20151029190807.GA18037@chaz.gmail.com> Comments: In reply to Stephane Chazelas "regexp-replace and ^" (Oct 29, 7:08pm) References: <20151029190807.GA18037@chaz.gmail.com> X-Mailer: OpenZMail Classic (0.9.2 24April2005) To: Zsh hackers list Subject: Re: regexp-replace and ^ MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii On Oct 29, 7:08pm, Stephane Chazelas wrote: } } Or maybe have a (E) for ERE and (P) for PCRE parameter expansion flags } for the ${var//pattern/replacement}. Each of (E) and (P) already means something else. It ought to be possible to fix regexp-replace. A leading "^" isn't that difficult, it just means the loop should only go around once (unless you expect it to match after embedded newlines). The tokens that match word breaks require more thought. I'm not sure what to make of lookaheads.