RegExp in Browser

Hello,

I have made a flash applet in which a string is checked using the RegExp.exec() method. This works fine when I test it locally, but when I upload it to my website, the RegExp no longer works. Why would this be? :S

Here is my code:

function comp(e:Event){
	var str:String = e.target.data;
	browser.text += e.target.data;
	var imgRE:RegExp = /<img[^>]+id\s*=\s*['"]([A-Za-z0-9]+)['"][^>]*\/\s*>/g;
	do{
		var exec:Object = imgRE.exec(str);
		if (exec) browser.text = exec[1];
	}while(exec);
}

var loader:URLLoader = new URLLoader();
loader.addEventListener(Event.COMPLETE, comp);
loader.load(new URLRequest("Content/home_2.html")); 

It loads an external HTML file and then checks it for img tags. It then takes the “id” parameter of the img tag (as exec[1]) and puts it into a textbox on the stage.

Thanks for your help - sorry if this is a stupid question!