Using Pregreplace on Multiple Simple Strings
===

I am trying to implement head.js to load all of my js files asynchronously.

To do this javascript files should be loaded in the following manner:

    <script>head.js("file1.js")</script>
    <script>head.js("file2.js")</script>
    <script>head.js("file3.js")</script>

If my files were styled as normal like:

    <script src="file1.js"></script>
    <script src="file2.js"></script>
    <script src="file3.js"></script>
 
I would be able to use something like this to get my desired result:

	$pattern = '~\<script src=(.*?)\>~';
	$replacement = '<script>head.js($1)>';
	$html = preg_replace($pattern,$replacement,$html);
        
However at the moment I have a minifier on my installation that combines the javascript files into the following style:

	<script src="http://mysite.com/js/file1.js,/js/file2.js,/js/file3.js"></script>
	
I am terrible with reg expressions...would anyone be able to help me out with a replacement pattern that would work convert it into the head.js format?

Almost forgot...the number of files is not limited to three, it will be more but the amount is unspecified.
