var string = "ThisIsStringWithOnlyLettersAndNumbers_АТакЖе-И_БезПробеловИТочек";
{"ScriptPreparationCode":"var string = \u0022ThisIsStringWithOnlyLettersAndNumbers_\u0410\u0422\u0430\u043A\u0416\u0435-\u0418_\u0411\u0435\u0437\u041F\u0440\u043E\u0431\u0435\u043B\u043E\u0432\u0418\u0422\u043E\u0447\u0435\u043A\u0022;","TestCases":[{"Name":"RegEx","Code":"let isValidTag = false;\r\nconst number = new RegExp(\u0022^[A-Za-z\u0410-\u042F\u0430-\u044F\u0401\u04510-9_\\-]\u002B$\u0022);\r\nisValidTag = number.test(string);","IsDeferred":false},{"Name":"Loop","Code":"let isValidTag = true;\r\nlet alphabet = \u0022ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz\u0410\u0411\u0412\u0413\u0414\u0415\u0401\u0416\u0417\u0418\u0419\u041A\u041B\u041C\u041D\u041E\u041F\u0420\u0421\u0422\u0423\u0424\u0425\u0426\u0428\u0429\u042A\u042B\u042C\u042D\u042E\u042F\u0430\u0431\u0432\u0433\u0434\u0435\u0451\u0436\u0437\u0438\u0439\u043A\u043B\u043C\u043D\u043E\u043F\u0440\u0441\u0442\u0443\u0444\u0445\u0446\u0448\u0449\u044A\u044B\u044C\u044D\u044E\u044F0123456789-_\u0022;\r\nfor (let i = 0; i \u003C string.length; i\u002B\u002B)\r\n{\r\n\tlet chr = string.charAt(i);\r\n \tif (alphabet.indexOf(chr) == -1)\r\n {\r\n isPasswordValid = false;\r\n break;\r\n }\r\n}","IsDeferred":false}]}