SVN commit 798908 by porten: Testing two more differences from Perl. M +10 -0 RegExp.js --- trunk/tests/khtmltests/regression/tests/js/RegExp.js #798907:798908 @@ -110,6 +110,16 @@ shouldBe("x[2]", "''"); // or, "/(\\3)(\\1)(a)/ failed to find '' in 'cat' as second part"); shouldBe("x[3]", "'a'"); // or, "/(\\3)(\\1)(a)/ failed to find 'a' in 'cat' as third part"); +// Empty character class matches nothing +var ok = false; +try { ok = (/[]/.exec('') == null); } catch (e) { } +shouldBeTrue("ok"); + +// [^] matches anything +ok = false; +try { ok = (/[^]/.exec('x') != null); } catch (e) { } +shouldBeTrue("ok"); + shouldBe("'1test2test3blah'.split(/test/).toString()","'1,2,3blah'"); var reg = /(\d\d )/g; var str = new String('98 76 blah');