public boolean validate(String str) throws Exception {
        if (str == "") {
            throw new Exception("login is not found");
        }
        str = str.toLowerCase();
        String pattern = "^[a-z][a-z0-9\\.,\\-_]{5,31}$";
        // Create a Pattern object
        Pattern r = Pattern.compile(pattern);
        // Now create matcher object.
        Matcher m = r.matcher(str);
        if (m.find()) {
            System.out.println("Found value: " + m.group(0));
            String url = "https://login.skype.com/json/validator?new_username=" + str;
            System.out.println("Url is  - " + url);
            String s = readUrl(url);
            if (s.contains("200")) {
                System.out.println("такого имени еще нет");
                return false;
            } else {
                System.out.println("такое имя уже есть");
                return true;
            }


        } else {
            System.out.println("NO MATCH");
            return false;
        }
    }