View Single Post
  #3   (View Single Post)  
Old 2nd December 2008
ephemera's Avatar
ephemera ephemera is offline
Knuth's homeboy
 
Join Date: Apr 2008
Posts: 537
Default

Quote:
Originally Posted by bigb89 View Post
Code:
<?php @include("http://".$_SERVER['HTTP_HOST']."/linkingblogv.php"); ?>
If you trying to match (and replace) this string literal then you don't need to use regex at all.
Though you will still need to take care of quoting and var. interpolation.

Try:
Code:
perl -i.bak -pe '$_="yabba dabba doo\n" if $_ eq qq(<?php \@include("http://".\$_SERVER[\047HTTP_HOST\047]."/linkingblogv.php"); ?>\n)' file
Reply With Quote