Skip to content

Instantly share code, notes, and snippets.

@Napear
Created April 15, 2020 02:12
Show Gist options
  • Save Napear/960b7dc9fef35368c97bef1faf02ec68 to your computer and use it in GitHub Desktop.
Save Napear/960b7dc9fef35368c97bef1faf02ec68 to your computer and use it in GitHub Desktop.
import re
def remove_parenthetical(input_string):
regex = re.compile("([\(\[]).*?([\)\]])")
return re.sub(regex, '', input_string).strip()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment