{"ScriptPreparationCode":"var string = \u0022Hello world\u0022;\r\n\r\nfunction subsequence_re(str) {\r\n let final = []\r\n for(var i = 0; i \u003C str.length; i \u002B= 1) {\r\n final[i] = \u0022(\u0022 \u002B str[i] \u002B \u0022)\u002B\u0022;\r\n }\r\n return new RegExp(final.join(\u0022(.)*\u0022));\r\n}\r\n\r\nfunction subsequence(a, b) {\r\n let index = 0\r\n for(let char of b) {\r\n if (a[index] === char) index \u002B= 1\r\n }\r\n return index == a.length\r\n}\r\n\r\nvar regexp = subsequence_re(\u0022Hello\u0022)","TestCases":[{"Name":"subsequence_re","Code":"subsequence_re(\u0022Hello\u0022).test(string);","IsDeferred":false},{"Name":"subsequence","Code":"subsequence(\u0022Hello\u0022, string);","IsDeferred":false},{"Name":"subsequence_re (using already determined regexp)","Code":"regexp.test(string);","IsDeferred":false}]}