public static boolean isIdentifier(String string){
  if (string == null || string.equals("")) {
    return false;
  }
  return string.matches("[A-Za-z0-9_]*[A-Za-z]{1}[A-Za-z0-9_]*");
}

public static boolean isIdentifier ( String string ) { if ( string == null || string . equals ( "" ) ) { return false ; } return string . matches ( "[A-Za-z0-9_]*[A-Za-z]{1}[A-Za-z0-9_]*" ) ; }
returns true , if the string matches [ a - za - z0 - 9_ ] * [ a - za - z ] { 1 } [ a - za - z0 - 9_ ]
