text: public static void validateSimple(String s, String legal)throws URISyntaxException {for (int i = 0; i < s.length(); i++) {char ch = s.charAt(i);if (!((ch >= 'a' && ch <= 'z')|| (ch >= 'A' && ch <= 'Z')|| (ch >= '0' && ch <= '9')|| legal.indexOf(ch) > -1)) {throw new URISyntaxException(s, "Illegal character", i);}}}