Paste this code into Firebug!
http://jsfiddle.net/THdtm/
/* match just the href of js includes */
var jsSrcRegex = /src=\"(.+?)\"/igm;
/* html for js include */
var html = '<script type="text/javascript" src="/
jquery-1.4.2.min.js"></script>';
console.dir(jsSrcRegex.exec(html));
console.log(html);
console.log(jsSrcRegex);
console.dir(jsSrcRegex.exec(html));
/*
No results? wtf?
Then wait!!!
add an extra console.log! and...
*/
console.dir(jsSrcRegex.exec(html));
/* results are back!! hmm... */