Matcher (String string) { Matcher result = LINE_AND_COLUMN.matcher(string); if (result.lookingAt()) { return result; } result = LINE_ONLY.matcher(string); if (result.lookingAt()) { return result; } return null; }