Test, validate and match regular expressions
Matches an opening <script> tag along with its attributes (e.g. lang="ts" or setup), captures the full script contents including newlines, and the closing </script> tag. The lazy [\s\S]*? groups ensure each match stops at the first closing tag rather than spanning multiple script blocks. With the global and multiline flags, it is well-suited for extracting one or more script blocks from Vue Single File Components, HTML pages, or other template files for further processing.