How to match a newline \n in a perl regex?
All I needed was /gm
on the end of my query, turns out it ignores new lines by default.
In some cases it might not work because of how perl "slurps" the input. Passing -0777
as a parameter will make it consider multiple lines. (Pass it along with your other parameters, e.g. perl -0777pi -e
)