Return-Path: X-Original-To: apmail-httpd-dev-archive@www.apache.org Delivered-To: apmail-httpd-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id E4A7D17384 for ; Thu, 1 Oct 2015 12:33:18 +0000 (UTC) Received: (qmail 44635 invoked by uid 500); 1 Oct 2015 12:33:18 -0000 Delivered-To: apmail-httpd-dev-archive@httpd.apache.org Received: (qmail 44562 invoked by uid 500); 1 Oct 2015 12:33:18 -0000 Mailing-List: contact dev-help@httpd.apache.org; run by ezmlm Precedence: bulk Reply-To: dev@httpd.apache.org list-help: list-unsubscribe: List-Post: List-Id: Delivered-To: mailing list dev@httpd.apache.org Received: (qmail 44552 invoked by uid 99); 1 Oct 2015 12:33:18 -0000 Received: from Unknown (HELO spamd1-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 01 Oct 2015 12:33:18 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd1-us-west.apache.org (ASF Mail Server at spamd1-us-west.apache.org) with ESMTP id 08F10C7B72 for ; Thu, 1 Oct 2015 12:33:18 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -0.101 X-Spam-Level: X-Spam-Status: No, score=-0.101 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, RCVD_IN_MSPIKE_H2=-0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=disabled Authentication-Results: spamd1-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com Received: from mx1-us-east.apache.org ([10.40.0.8]) by localhost (spamd1-us-west.apache.org [10.40.0.7]) (amavisd-new, port 10024) with ESMTP id guWmaPKFQMM4 for ; Thu, 1 Oct 2015 12:33:14 +0000 (UTC) Received: from mail-ig0-f171.google.com (mail-ig0-f171.google.com [209.85.213.171]) by mx1-us-east.apache.org (ASF Mail Server at mx1-us-east.apache.org) with ESMTPS id C3B9F42B5D for ; Thu, 1 Oct 2015 12:33:13 +0000 (UTC) Received: by igbni9 with SMTP id ni9so13386394igb.0 for ; Thu, 01 Oct 2015 05:33:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=o/LJEf2o8bporZvgzuHGDDM+avgpMnp8QoGP6WK/jDQ=; b=HxQDYlajMFwM8UoYS08qwRXeYigc2Y3/h7ZSy937Kjty2GR52XB/erTGmfpU21ZGuN S5EL2Lk9vaOCbT7tAnWUIaHfF8cXZeq8/VCyor80dpK6ypQe9Ak5d+1fj8Abf297wMvo YPYrKTuqdY9U9sF+/cM02XTEBM3MnudtVqQ7iH/JHVMtDo7UbRv43Xs1jqWS/wJkszTY 25AWW6vycY+41PxDVu3SZK28+JsgVvMiL/9MqA5k33+ogifbaQLadZy/Lm1MHPwjSDoN 0IjXqWdUcEYerXiKwzVETvmMTnQy3j34IucrL0gx5e0NITVl6CMYFqh5o9V4PKXuvJrU w14Q== MIME-Version: 1.0 X-Received: by 10.50.141.234 with SMTP id rr10mr2827156igb.56.1443702793284; Thu, 01 Oct 2015 05:33:13 -0700 (PDT) Received: by 10.64.25.3 with HTTP; Thu, 1 Oct 2015 05:33:13 -0700 (PDT) In-Reply-To: <560D0A3F.9010609@kippdata.de> References: <560D0A3F.9010609@kippdata.de> Date: Thu, 1 Oct 2015 08:33:13 -0400 Message-ID: Subject: Re: Expression Parser: search and replace with s/PATTERN/REPLACEMENT/FLAGS From: Eric Covener To: Apache HTTP Server Development List Content-Type: text/plain; charset=UTF-8 On Thu, Oct 1, 2015 at 6:26 AM, Rainer Jung wrote: > Since it gets more common to use the expression parser for string operations > and not only for boolean checks, I think it would be useful (and powerful) > to support > > s/PATTERN/REPLACEMENT/FLAGS > > and allow back references in REPLACEMENT. The operation would not try to do > the replacement in place but create a new string according to the given > PATTERN and REPLACEMENT. > > I had a quick look at the flex and bison files which generate lexer and > parser but must admit that it wasn't immediately obvious to me how to do it. > I can try harder but first wanted to ask if there are any volunteers who > know that technology better than me. Stefan (Frisch)? Others? > > Otherwise I'll try myself (and learn new stuff on the way). I've tried and failed to hack the exact same thing in a few times. I agree it would be great to have.