I have a string
<h1>hello/h1>
<script src="http://www.test.com/file1.js"></script>
<script src="http://www.test.com/file2.js"></script>
<p>bye</p>
and I need to generate an array with the urls found in the string.
['http://www.test.com/file1.js', 'http://www.test.com/file2.js']
also I need to replace the entire line (including the tags script tags) with nothing.
this is what I have so far to find the urls
^(<script src=")(.*)("><\/script>)$
problem with that is that it only works with
<script src="http://www.test.com/file1.js"></script>
if I define my scripts like this
<script id="something" src="http://www.test.com/file1.js"></script>
it doesn't work.