Does it matter? You can create regex with lookahead for </script>. The point is that it's possible to solve the problem from SO this way, due to the nature of the problem, not that this particular expression is perfectly correct.
It seems the article does defend "it's possible" for strictly regular expressions. To allow lookahead will be context-sensitive, so not in that spirit.