public Boolean isStringValid(String in) {
		//System.out.println("M " + in + " M");
		
		Boolean returnVal=Boolean.TRUE;
    if (in==null || in.length()==0) return returnVal;

    try {
      for (int i=0; i<in.length(); ) {
        int start=startChars.indexOf(in.charAt(i));
        if (start!=-1) {
          int end=in.indexOf(endChars.charAt(start), i);
          if (end==-1) // start found but not end
            throw new IsStringValidNotValidException();
          Boolean rtn=
							isStringValid(in.substring(i+1, end));
          if (rtn==Boolean.FALSE)
							throw new IsStringValidNotValidException();
          i=end+1;
        }
        else {
          int endWithoutStart=endChars.indexOf(in.charAt(i));
          if (endWithoutStart!=-1)
            throw new IsStringValidNotValidException();
          ++i;
        }
      }
		}
		catch (IsStringValidNotValidException e) {
			// just set return value to false
			returnVal=Boolean.FALSE;
		}
		catch (Exception e) {
			// FIXME: weak error handling, just in case
			e.printStackTrace();
			returnVal=Boolean.FALSE;
		}
		
		return returnVal;
	}