Click to See Complete Forum and Search --> : RegExp issues..


Mitsukai
May 9th, 2008, 06:19 AM
hi i have the folowing code.

var re = new RegExp("(\{\w+\})+", "gim");
var found = re.exec("agsdfg{sdfgsdfg}sdfgsdfg{ertwfg}rhfg");
alert(found);

but found is null....

i tried testing this regexp with this website:
http://www.regular-expressions.info/javascriptexample.html

and it worked...

did i do anything wrong?

PeejAvery
May 9th, 2008, 10:41 AM
var re = new RegExp(/(\{\w+\})+/gim);

Mitsukai
May 9th, 2008, 10:43 AM
oh thanks that is weird..