How does a regular match a complete script tag

html is as follows:

<body>
    <temlate></template>
    <script>
        var str = `<script>var html="abc";</script>
                    <style></style>
                `;
    </script>
    <style></style>
</body>

how to match:

<script>
    var str = `<script>var html="abc";</script>
                <style></style>
            `;
</script>

if you step on the problem, would you please tell me where the problem needs to be improved? Just step on it?

Mar.05,2021

View matching results


html.match(/<script[^>]*>(?:.*?)<\/script>/)[0]
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1e45c2f-44b57.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1e45c2f-44b57.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?