So I try to replace blank space at the beginning of the line like so.
Original :
this
is
\tsome
text
What I want :
+this
+is
+
+some
+ text
I tried to use this regex to do that :
echo -e 'this\n is\n\n\tsome\n text' |
perl -wpe 's/^\s?(.*)/+$1/'
But this is the result for that :
+this
+is
++some
+ text
So my line with no text at all is not processed correctly. Or rather, I don't understand why it behaves like that.
Any idea why ?
Thanks !