Python/Regex: I'm looking for the most elegant way to split up an HTML
string to an array of strings where the delimiter is a script
tag. So for:
<p> paragraph one </p>
<script src="https://something.com/script.js"></script>
<p> paragraph two </p>
<p> paragraph three </p>
<script src="https://something.com/script.js"/>
<p> paragraph four </p>
I would get the following array of strings:
[
'<p> paragraph one </p>',
'<script src="https://something.com/script.js"></script>',
'<p> paragraph two </p><p> paragraph three </p>',
'<script src="https://something.com/script.js"/>',
'<p> paragraph four </p>'
]
I would appreciate a pointer in the right direction.