Sed: delete on each line before a character and after a character

Hi there,
A total sed noob here. Is there a way using sed to delete everything before a character AND after another character on each line in a file? The deletion should also delete the indicating characters(here: an opening and a closing parenthesis).
The original file would look like this:

blah (keep this) blah
bladiblah (another thing to keep) blabla

I would like the resulting file to look like this:

keep this
another thing to keep

I have already scoured the forum for answers but to no avail... Any help much appreciated. Thanks.

sed 's/.*[(]//; s/[)].*//' file
1 Like

Thanks! That did the trick.

The parens are not required to be put in bracket expressions.

1 Like