code: public static boolean isIdentifier(CharSequence s) {
          int limit=s.length();
          if(limit==0) {
              return false;
          }
          int start=0;
          do {
              if(isSyntaxOrWhiteSpace(s.charAt(start++))) {
                  return false;
              }
          } while(start<limit);
          return true;
      }
docs: Tests whether the CharSequence contains a "pattern identifier", that is,
  whether it contains only non-Pattern_White_Space, non-Pattern_Syntax characters.
  @return true if there are no Pattern_White_Space or Pattern_Syntax characters in s.