The #WordPress function wp_strip_all_tags removes script and style tags using this #regex:
<(script|style)[^>]*?>.*?</\1>
Are those question marks necessary? What are they saying is optional? The asterisks preceding them are already saying that those characters are optional.
https://github.com/WordPress/wordpress-develop/commit/b7f82a38b502a8fc513883f6675916da340c0be5