void (@NotNull CharSequence text, @NotNull IssueNavigationLink link, @NotNull List<LinkMatch> result) { Pattern issuePattern = link.getIssuePattern(); Matcher m = issuePattern.matcher(text); while (m.find()) { try { String replacement = issuePattern.matcher(m.group(0)).replaceFirst(link.getLinkRegexp()); addMatch(result, new TextRange(m.start(), m.end()), replacement); } catch (Exception e) { LOG.debug("Malformed regex replacement. IssueLink: " + link + "; text: " + text, e); } } }