{"ScriptPreparationCode":"const testPath = \u0022http://foo.org/smth/teachers/ad0bfc84-3d16-46c3-948c-2f8d08976fcc/bar\u0022;\r\nconst userIdPathSegments = [\u0027students\u0027, \u0027teachers\u0027];\r\nconst userIdPathSegmentRegexps = [new RegExp(/\\/students\\/(?\u003CuserId\u003E\\w\u002B)/), new RegExp(/\\/teachers\\/(?\u003CuserId\u003E\\w\u002B)/)];\r\nconst userIdPathSegments2 = [\u0027/students/\u0027, \u0027/teachers/\u0027];","TestCases":[{"Name":"split","Code":"const pathParts = testPath.split(\u0027/\u0027).filter(p =\u003E p);\r\nconst userIdIndex = pathParts.findIndex(p =\u003E userIdPathSegments.some(aPN =\u003E p === aPN));\r\nif (userIdIndex \u003E= 0 \u0026\u0026 pathParts.length \u003E userIdIndex \u002B 1) {\r\n\tpathParts[userIdIndex \u002B 1];\r\n}","IsDeferred":false},{"Name":"regex","Code":"for (let i = 0; i \u003C userIdPathSegmentRegexps.length; i\u002B\u002B) {\r\n const match = testPath.match(userIdPathSegmentRegexps[i]);\r\n if (Array.isArray(match) \u0026\u0026 match.length == 2 \u0026\u0026 match[1].length \u003E 0) {\r\n match[1];\r\n }\r\n}","IsDeferred":false},{"Name":"string includes","Code":"for (let i = 0; i \u003C userIdPathSegments2.length; i\u002B\u002B) {\r\n if (testPath.includes(userIdPathSegments2[i])) {\r\n testPath.includes(userIdPathSegments2[i] \u002B \u0022ad0bfc84-3d16-46c3-948c-2f8d08976fcc\u0022);\r\n }\r\n}","IsDeferred":false}]}