Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id E4C69200BC5 for ; Tue, 22 Nov 2016 19:03:18 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id E362B160B0C; Tue, 22 Nov 2016 18:03:18 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 14915160AF1 for ; Tue, 22 Nov 2016 19:03:17 +0100 (CET) Received: (qmail 93703 invoked by uid 500); 22 Nov 2016 18:03:16 -0000 Mailing-List: contact users-help@httpd.apache.org; run by ezmlm Precedence: bulk Reply-To: users@httpd.apache.org list-help: list-unsubscribe: List-Post: List-Id: Delivered-To: mailing list users@httpd.apache.org Received: (qmail 93693 invoked by uid 99); 22 Nov 2016 18:03:16 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd4-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 22 Nov 2016 18:03:16 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd4-us-west.apache.org (ASF Mail Server at spamd4-us-west.apache.org) with ESMTP id 4F783C036D for ; Tue, 22 Nov 2016 18:03:15 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd4-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 2.399 X-Spam-Level: ** X-Spam-Status: No, score=2.399 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HTML_MESSAGE=2, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, RCVD_IN_SORBS_SPAM=0.5, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=disabled Authentication-Results: spamd4-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd4-us-west.apache.org [10.40.0.11]) (amavisd-new, port 10024) with ESMTP id Kd6tcyYKF_NF for ; Tue, 22 Nov 2016 18:03:13 +0000 (UTC) Received: from mail-io0-f173.google.com (mail-io0-f173.google.com [209.85.223.173]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTPS id 93A2560D2C for ; Tue, 22 Nov 2016 18:01:53 +0000 (UTC) Received: by mail-io0-f173.google.com with SMTP id a124so1111508ioe.2 for ; Tue, 22 Nov 2016 10:01:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to; bh=31npnSzfdgcrgu/IFovy4p5utiudgi6uECV5CR2RfPM=; b=ZZ0+FgCM+BhxdaK616tG468+kgeiyhUxs1meUqAl7BUz04bq1lSR6rgafpt1Zi8EPM dSX9Rbitqe21xaEYNgwamlSGpVka5a8x4wLSQ/b+b7EEH0hTTbc5tOp1tMoUa23t1wQX n2KrGvBQkvaeYtNucW/v5uRH73z0qq2pBq3YC7pPdxu5ls8NulyjnvBS8J4nmiiRwTf2 3DPgUZDWU3wlzyElbFcZ/06dbyAwR6QJPStztboNljsTrZPrQYDJRj3C0dXk1G/kF+Yw eDa+5pEPW/p2xJ4HIv5uh/Fcfpa6wfqsBziq1xJIkFju4gANvMqxS6fH5dREW3g86+nx cATA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to; bh=31npnSzfdgcrgu/IFovy4p5utiudgi6uECV5CR2RfPM=; b=kqrS44p9iu8SCePZ+uwJgwseAmSOabaAlwuUwfWu2QlSVDHr7xdoASZlok2AyYeUri MPa/vwLh9hwyhC/24hXlQql+DDyheoHl6+chAEsVQ4MZmIckJCC2KIWvWVX/U5tNeHGQ 8kYGtwK9VO8kWGXnQZ1U3FO8qtUhwbQc0PCfAwBII6zeXp9gWeQEk2xOnT8ycgbN0dlx Mt411I0A38/1/HGWMOVA3IAC8g2IbIqegw51BxUQJCgoqzNILNP3hbD38+J9X60y4FCR kyHAK/2nEWRC0KzJ9qPQEwTNcagPaj1y3TiXrxkUrNN1mpwBeK7iBwH2jcL07FXZnJ1R 9iZA== X-Gm-Message-State: AKaTC00tYMxqHDW0VwWahNt/YjpPUWETqFxOy9mUiN5AhQzD8KeAMDF85eMVL4QvY0v0L2VAi6w59ziTueE9Gg== X-Received: by 10.107.187.69 with SMTP id l66mr17137460iof.174.1479837712111; Tue, 22 Nov 2016 10:01:52 -0800 (PST) MIME-Version: 1.0 Received: by 10.107.41.20 with HTTP; Tue, 22 Nov 2016 10:01:51 -0800 (PST) In-Reply-To: <0495c9cb-1dc3-ed8b-a0a0-7e49c8b682b7@gmail.com> References: <0495c9cb-1dc3-ed8b-a0a0-7e49c8b682b7@gmail.com> From: Mayuresh Date: Tue, 22 Nov 2016 10:01:51 -0800 Message-ID: To: users@httpd.apache.org Content-Type: multipart/alternative; boundary=94eb2c05d46c27e0400541e7918a Subject: Re: [users@httpd] Mod_Substitute - Match the last occurrence of a string in the response archived-at: Tue, 22 Nov 2016 18:03:19 -0000 --94eb2c05d46c27e0400541e7918a Content-Type: text/plain; charset=UTF-8 Hi, I am able to modify the response. The problem is it is happening per line. so with something like this: Substitute "s|(.*]*>)|$1|i" It is doing the replacement for all the meta tags in the html. I just want it to happen for the last occurrence. James, I tried your suggestion, but it works for all the lines. On Tue, Nov 22, 2016 at 9:51 AM, bob gailer wrote: > On 11/22/2016 11:50 AM, Mayuresh wrote: > >> Hi, >> >> How can I check for the last occurrence of a string in the response html >> and only replace the last occurrence of it? >> >> I want to search for the last "meta" tag in the response and replace it >> with something. >> > Sorry - I just noticed Mod_Substitute in your subject > > Check https://serverpilot.io/community/articles/how-to-use-apache- > to-replace-strings-in-responses.html > > It points to http://httpd.apache.org/docs/2.4/mod/mod_substitute.html. > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org > For additional commands, e-mail: users-help@httpd.apache.org > > -- -Mayuresh --94eb2c05d46c27e0400541e7918a Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Hi,

I am able to modify the response. T= he problem is it is happening per line. so with something like this:
<= div>

Substitute "s|(.*<me= ta [^>]*>)|$1<script>window['start-time'] =3D new Date(= ).getTime();</script><script src=3D'/epicdev.js'></s= cript>|i"

=

It is doing t= he replacement for all the meta tags in the html. I just want it to happen = for the last occurrence.


James,= I tried your suggestion, but it works for all the lines.

<= /div>

On Tue, Nov = 22, 2016 at 9:51 AM, bob gailer <bgailer@gmail.com> wrote:
On 11/22/2016 11:50 AM, M= ayuresh wrote:
Hi,

How can I check for the last occurrence of a string in the response html an= d only replace the last occurrence of it?

I want to search for the last "meta" tag in the response and repl= ace it with something.
Sorry - I just noticed Mod_Substitute in your subject

Check https://serverpilot.io/community/articles/how-to-use-apache-to-= replace-strings-in-responses.html

It points to http://httpd.apache.org/docs/2<= wbr>.4/mod/mod_substitute.html.
=


-----------------------------------------------------------------= ----
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org




--
=
-Mayuresh=
--94eb2c05d46c27e0400541e7918a--