So I have been trying to figure out how to get PERL and SED to replace a set of random characters in a line with a fixed set of characters. I tried for about 2 days on Perl and sed, but could not get it to work right. So last night I tried PHP and got it in one shot. So say I have a file that has a part of a line that looks like this:


and I want to replace what ever is in the Variable2 value to be just a bunch of X’s or some other fixed value. Nothing I could do in sed and Perl would work, I ended up with this in PHP:


So can any one tell me how to do it in Perl or sed?

One Reply to “PHP 1, PERL & SED 0”

  1. s/1=test.*Variable3/1=testXXXXXXXXXX\&variable3/


Comments are closed.