{"ScriptPreparationCode":null,"TestCases":[{"Name":"indexOf","Code":"let placeholders = [\r\n \u0027country_adwad\u0027,\r\n \u0027country_adwad?adwas=true\u0027,\r\n \u0027country_adwad#anchor\u0027,\r\n \u0027country_adwad?adwas=true#anchor\u0027\r\n];\r\nplaceholders.forEach((placeholder) =\u003E {\r\n var placeholderLength = placeholder.length;\r\n var endPageId = placeholder.indexOf(\u0027?\u0027) !== -1 ? placeholder.indexOf(\u0027?\u0027) : \r\n placeholder.indexOf(\u0027#\u0027) !== -1 ? placeholder.indexOf(\u0027#\u0027) : placeholderLength;\r\n console.log(placeholder.substring(0, endPageId), placeholder.substring(endPageId, placeholderLength));\r\n});","IsDeferred":false},{"Name":"regex","Code":"let placeholders = [\r\n \u0027country_adwad\u0027,\r\n \u0027country_adwad?adwas=true\u0027,\r\n \u0027country_adwad#anchor\u0027,\r\n \u0027country_adwad?adwas=true#anchor\u0027\r\n];\r\nplaceholders.forEach((item) =\u003E {\r\n const regexp = /^([a-zA-Z-_]\u002B)[?#]?(.*)?/;\r\n let match = item.match(regexp);\r\n let pageID = match[1];\r\n let queryString = match[2];\r\n console.log(pageID, queryString);\r\n});","IsDeferred":false}]}