I'm trying to parse the following multiline string (starting with ) and comment it out.
-->
<Connector port="8080" protocol="HTTP/1.1"
connectionTimeout="20000"
redirectPort="8443" />
<!-- A "Connector" using the shared thread pool-->
So I tried using the following:
perl -i.bak -pe 'BEGIN{undef $/;}
s/
\s+ #space at beginning of line
(<Connector\s+ #connector
port=\"8080\"\s+ #port
protocol=\"HTTP\/1\.1\" #protocol
\n #newline
\s+connectionTimeout=\"20000\"\n # space, connection timeout, then newline
\s+redirectPort=\"8443\" #redirect port
\/> # end of connector entry in file
) # end capture for $1
/
<!--$1-->
/msx
' server.xml
diff server.xml server.xml.bak
But the diff output shows nothing. Any idea what I'm missing here?