# RegExp in Browser

**URL:** <https://forum.kirupa.com/t/regexp-in-browser/238262>\
**Category:** flash\
**Created:** [September 9, 2007, 3:25am UTC](https://forum.kirupa.com/t/regexp-in-browser/238262 "2007-09-09T03:25:02Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Septenary](https://avatars.discourse-cdn.com/v4/letter/s/ebca7d/32.png) [@Septenary](https://forum.kirupa.com/u/Septenary)\
**Post date:** [September 9, 2007, 3:25am UTC](https://forum.kirupa.com/t/regexp-in-browser/238262/1 "2007-09-09T03:25:02Z")

</div>

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:

```auto
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!
