int (final boolean line) { final Matcher matcher = patternToDetectLinesAndColumns.matcher(getTrimmedText()); if (matcher.matches()) { final int groupNumber = line ? 2 : 3; try { if (groupNumber <= matcher.groupCount()) { final String group = matcher.group(groupNumber); if (group != null) return Integer.parseInt(group) - 1; } if (!line && getLineOrColumn(true) != -1) return 0; } catch (NumberFormatException ignored) { } } return -1; }