code: protected static int getProperty(String name, String stty) {
          // try the first kind of regex
          Pattern pattern = Pattern.compile(name + "\\s+=\\s+([^;]*)[;\\n\\r]");
          Matcher matcher = pattern.matcher(stty);
          if (!matcher.find()) {
              // try a second kind of regex
              pattern = Pattern.compile(name + "\\s+([^;]*)[;\\n\\r]");
              matcher = pattern.matcher(stty);
              if (!matcher.find()) {
                  // try a second try of regex
                  pattern = Pattern.compile("(\\S*)\\s+" + name);
                  matcher = pattern.matcher(stty);
                  if (!matcher.find()) {
                      return -1;
                  }
              }
          }
          return parseControlChar(matcher.group(1));
      }
docs: <p>
  Parses a stty output (provided by stty -a) and return the value of a given property.
  </p>
  
  @param name property name.
  @param stty string resulting of stty -a execution.
  @return value of the given property.