I have a source file where I use a macro to do logging. Typical logging lines look like:
STDOUT_LOG(logDEBUG4) << \"a single line log text\" << aVari
In the end the command that successfully did what I wanted was the following:
perl -0777pne 's/STDOUT_LOG\((.*?)\)(.*?)<<(.*?);/STDOUT_LOG\(\1\,\2\3\);/gs' sensor.cpp
This is alot a superposition for the answers of "Federico Piazza" and "zdim". You'll notice I prepended the "STDOUT_LOG" bit in the front to really much exactly what I wanted in a large number of source files. I noticed that for correct matching one MUST include the /s
operator at the end of the regex , but also add the -0777
flag in the perl executable.
see perlrun for an explanation of the runtime perl executable flags