Home | History | Annotate | Download | only in regex

Lines Matching refs:RegExp

24 description("This page tests toString conversion of RegExp objects, particularly wrt to '/' characters and RegExp.prototype.");
30 re1 = new RegExp(pattern);
38 re1 = new RegExp(pattern);
43 shouldBe("RegExp('/').source", '"\\\\/"');
44 shouldBe("RegExp('').source", '"(?:)"');
45 shouldBe("RegExp.prototype.source", '"(?:)"');
47 shouldBe("RegExp('/').toString()", '"/\\\\//"');
48 shouldBe("RegExp('').toString()", '"/(?:)/"');
49 shouldBe("RegExp.prototype.toString()", '"/(?:)/"');
54 // This string passes "^\/$" to the RegExp, so the '/' is escaped in the re!
56 // These strings pass "^\\/$" and "^\\\/$" respectively to the RegExp, giving one '\' to match.
77 shouldBe("RegExp('[/]').source", "'[/]'");
78 shouldBe("RegExp('\\\\[/]').source", "'\\\\[\\\\/]'");
83 // String value of the source property of this RegExp object, and "/";
86 // evaluates to another RegExp object with the same behaviour as this object.
87 shouldBe("var o = new RegExp(); o.toString() === '/'+o.source+'/' && eval(o.toString()+'.exec(String())')", '[""]');