These days in the project you need to use JS to replace the contents of the script tag
You can make a match with your own string, but once you have a large string of DOM content to match,
has been prompted to fail.
Surf the internet to find a lot of information, has not matched, debugging for a long time
Depressed time, a flash of light, difficult is the problem of the line, a test, sure enough.
var str = ' lkjkjk ' + ' <script type=text/html> abc </SCRIPT> 'var reg =/<script.* >.*<\/script>/Gialert (reg.test (str))
Prompt true
var str = ' lkjkjk ' + ' <script type=text/html> abc\n </SCRIPT> 'var reg =/<script.* >.*<\/script>/Gialert (reg.test (str))
Prompt false
Finally, the line break is added to the matching rule to successfully
var str = ' <script type=text/html> ffff \n</script> 'var reg =/<script.*> ([\s\s]*?) <\/script>/Gialert (reg.test (str))
JS replaces the contents of the script tag, including line break