, Pev wr, , :
pattern = r"(?is)<script[^>]*>(.*?)</script>"
text = """<script>foo bar
baz bar foo </script>"""
re.sub(pattern, '', text)
(? is) - - . script .
EDIT: , . , . lxml . , . Beautiful Soup (? , , ).
, , :
pattern = r"(?is)(<script[^>]*>)(.*?)(</script>)"
text = """<script>foo bar
baz bar foo </script>"""
re.sub(pattern, '\1\3', text)