LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   sed error: "parentheses not balanced" - But they are! (https://www.linuxquestions.org/questions/programming-9/sed-error-parentheses-not-balanced-but-they-are-216888/)

Travis86 08-12-2004 06:04 PM

sed error: "parentheses not balanced" - But they are!
 
I have a list of words, and some of them have parentheses around them like:
" (( hello )) "

I'm trying to remove them with sed, but it says that "parentheses not balanced"

The sed command is:
sed "s/([ ]?\)\)[ ]?)|([ ]?\(\([ ]?)/ /"

... and the exact error is:
sed: 1: "s/([ ]?\)\)[ ]?)|([ ]?\ ...": RE error: parentheses not balanced

You can see I escape all of the literal parentheses. What am I doing wrong?

Thanks.

jlliagre 08-12-2004 06:48 PM

try:
sed "s/((\([^)]*\)))/\1/g"

Travis86 08-12-2004 07:08 PM

Ok, that works. Thanks..


All times are GMT -5. The time now is 06:17 PM.