Let’s say I have bunch of lines
echo "<br/>";
echo "<pre>";
error_log("whatever");
echo "</pre>";
echo "<br/>";
and I want to comment them out, I can run this command
s/^/#
but it puts the # sign right in beginning of the line and not in front of first word so it looks like the lines below
# echo "<br/>";
# echo "<pre>";
# error_log("whatever");
# echo "</pre>";
# echo "<br/>";
How can I make it look like more like the code below
#echo "<br/>";
#echo "<pre>";
#error_log("whatever");
#echo "</pre>";
#echo "<br/>";
What’s the proper reg ex for that?
There are many ways. Here is one: