--- /dev/null
+regexp_simple: {
+ input: {
+ /rx/ig
+ }
+ expect_exact: "/rx/gi;"
+}
+
+regexp_slashes: {
+ input: {
+ /\\\/rx\/\\/ig
+ }
+ expect_exact: "/\\\\\\/rx\\/\\\\/gi;"
+}
+
+regexp_1: {
+ input: {
+ console.log(JSON.stringify("COMPASS? Overpass.".match(/([Sap]+)/ig)));
+ }
+ expect: {
+ console.log(JSON.stringify("COMPASS? Overpass.".match(/([Sap]+)/gi)));
+ }
+ expect_stdout: '["PASS","pass"]'
+}
+
+regexp_2: {
+ options = {
+ evaluate: true,
+ unsafe: true,
+ }
+ input: {
+ console.log(JSON.stringify("COMPASS? Overpass.".match(new RegExp("([Sap]+)", "ig"))));
+ }
+ expect: {
+ console.log(JSON.stringify("COMPASS? Overpass.".match(/([Sap]+)/gi)));
+ }
+ expect_stdout: '["PASS","pass"]'
+}
function f(s) {
return s.split(/[\\/]/);
}
+ console.log(JSON.stringify(f("A/B\\C\\D/E\\F")));
}
- expect_exact: "function f(s){return s.split(/[\\\\/]/)}"
+ expect: {
+ function f(s) {
+ return s.split(/[\\/]/);
+ }
+ console.log(JSON.stringify(f("A/B\\C\\D/E\\F")));
+ }
+ expect_stdout: '["A","B","C","D","E","F"]'
}