Skip to content
Advertisement

Replace the string/line after separator on specific param

I have the following Perl one liner code ,

My target is to replace the line after “=” separator, and that defined in PARAM variable

JavaScript

But actually its replace all the line include the PARAM itself

The expected results should be

JavaScript

Please advice what need to fix in my Perl one liner code?

other example that still not work:

JavaScript

Advertisement

Answer

You can use K (positive look behind) and .+ to remove everything after PARAM= until newline,

JavaScript

or for older perl,

JavaScript
User contributions licensed under: CC BY-SA
8 People found this is helpful
Advertisement