I'm trying to add parenthesis to beginning and end of line in Notepad++. Using sed I would do:
sed -i 's/^/(/' filename
sed -i 's/$/)/' filename
and be done, but I have to use Notepad ++ on Windows. I went to find and replace, chose regular expressions and tried to replace "^" with "(", but I got "zero length match" and it doesn't add the character (same with replacing "$" with ")").
What am I doing wrong?
Sorry, found the answer right after I posted the question. In case anyone is curious, in Notepad++ you have to escape the parenthesis characters whereas you don't have to in sed.
In Notepad++, under "Replace with", choose:
\(
and it will work.
In the search field put ^(.*)$
and in the replace field \(\1\)
. This worked just fine for me.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With