Firefox 3.1b2 has a problem with \n.
Test OK <div id="test1" class="metadata {type : 'p',colors : ['5131C9'],size : '300x200'}"></div> Test KO <div id="test2" class="metadata { type : 'p', colors : ['5131C9'], size : '300x200' }"></div> you can use this solution to fix this bug: cre.exec( string.replace("\n","") );