I want to do something like this:
/<script[^>]*>(?!<\/script>)*<\/script>/g
to combine all script tags in an html string using javascript.
I know this will not work, but I cannot find any other solutions. script -tag can either use the src attribute, or close it immediately after ( <script src="..." type="text/javascript"></script>), or it can contain code in script -tag ( <script type="text/javascript">...</script>)
<script src="..." type="text/javascript"></script>
<script type="text/javascript">...</script>
You were close
/<script[^>]*>(?:(?!<\/script>).)*<\/script>/g
You should have something to eat the actual body of the script. What is doing here ..
.
, ( ) . script 1, (?:...), , @AlanMoore, .
(?:...)
/<script[^>]*>.*?<\/script>/g
. .*? - , , .
.*?