int (String text, int groupNumber) { final Matcher matcher = ourPatternToDetectLinesAndColumns.matcher(text); if (matcher.matches()) { try { if (groupNumber <= matcher.groupCount()) { final String group = matcher.group(groupNumber); if (group != null) return Integer.parseInt(group) - 1; } } catch (NumberFormatException ignored) { } } return -1; }