httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dr James Smith <...@sanger.ac.uk>
Subject Re: [users@httpd] Mod_Substitute - Match the last occurrence of a string in the response
Date Tue, 22 Nov 2016 17:36:36 GMT
Never used mod_substitute - but the standard PCRE way is s/(.*)<meta... 
 >/$1..../mxs - the .* will capture greedily - so captures all but last 
meta...



On 22/11/2016 16:50, 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.
>
> How can I do this?
>
> Thanks,
> Mayuresh




-- 
 The Wellcome Trust Sanger Institute is operated by Genome Research 
 Limited, a charity registered in England with number 1021457 and a 
 company registered in England with number 2742969, whose registered 
 office is 215 Euston Road, London, NW1 2BE. 
Mime
View raw message