i am writing a php script that compress local javascript files into one from an html page. Now i want to delete local references except external javascript files.
for example, i have following variables.
$my_domain = "mysite";
$base_url ="http://www.mysite.com"
I want to delete all local javascript references except external. local javascript include sub-domain too. For Example, http://www.mysite.com/script/jquery.js and http://dev.mysite.com/scripts/test.js is the example of local javascript files.
i want to use regular expression for this.
EDIT: The format is :
<script src="http://www.mysite.com/jsfile.js"></script>
EDIT 2: The script in a page is like:
<script type="text/javascript" src="http://localhost/test/example/Scripts/superfish/js/hoverIntent.js"></script>
<script type="text/javascript" src="http://localhost/test/example/Scripts/superfish/js/superfish.js"></script>
where $baseURL="http://localhost/test/example";
it is currently not replacing.