I am trying to split with this regex ({[^{}]*})
in javascript and I get different result btw IE7 and FF. The firefox result is the right one.
&l
I made a solution that works on regex({[^{}]*})
and probably others too.
function ieSplit(str, separator) {
var match = str.match(RegExp(separator, 'g'));
var notmatch = str.replace(new RegExp(separator, 'g'), '[|]').split('[|]');
var merge = [];
for(i in notmatch) {
merge.push(notmatch[i]);
if (match != null && match[i] != undefined) {
merge.push(match[i]);
}
}
return merge;
}
alert(ieSplit(text, '({[^{}]*})'));
// result in FF : .box.round ,{border-radius: 10px;},
// result in IE7: .box.round ,{border-radius: 10px;},