code: private static boolean hasUnsafeChars(String s) {
          for (int i = 0; i < s.length(); ++i) {
              char c = s.charAt(i);
              if (Character.isLetter(c) || c == '.')
                  continue;
              else
                  return true;
          }
          return false;
      }
docs: full parser to deal with.