code: public static boolean isValidCallback(String pCallback) {
          Pattern validJavaScriptFunctionNamePattern =
              Pattern.compile("^[$A-Z_][0-9A-Z_$]*$", Pattern.CASE_INSENSITIVE);
          return validJavaScriptFunctionNamePattern.matcher(pCallback).matches();
      }
docs: Check that a callback matches a javascript function name. The argument must be not null
  
  @param pCallback callback to verify
  @return true if valud, false otherwise