Using sed to delete a string between parentheses
问题 I'm having trouble figuring how to delete a string in between parentheses only when it is in parentheses. For example, I want to delete the string "(Laughter)", but only when it's in parenthesis and not just make it a case sensitive deletion since a sentence within that string starts with Laughter. 回答1: I'm not sure I understand you correctly, but the following will remove text between parentheses: sed "s/[(][^)]*[)]/()/g" myfile (or as Llama pointed out in comments, just:) sed "s/([^)]*)/()