Using GNU sed, I need to remove parenthetical phrases like (click here ....) including the parens. The text following click here varies, but I need to remove the whole outer parentheses.
I've tried many variations on the following, but I can't seem to hit the right one:
sed -e 's/\((click here.*[^)]*\)//'
EDIT Foolishly I didn't notice that there's often actually a linebreak in the middle of the parenthetical string, so sed probably isn't going to work. Example:
(click here to
enter some text)
If there aren't nested parens, maybe you can try something like:
sed -e 's/(click here [^)]*)//'
With perl you can run :
perl -00 -pe "s/\(click here [^)]*\)//g" inputfile > outputfile
It will read the inputfile in a string then replace all occurrences of (click here anychar but '(' ) then output all in the outputfile.
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