void (RegExpPattern pattern) { final RegExpBranch[] branches = pattern.getBranches(); if (branches.length < 2) { return; } if (!ContainerUtil.and(branches, SingleCharAlternationVisitor::isSingleChar)) { return; } final String text = buildReplacementText(pattern); myHolder.registerProblem(pattern, RegExpBundle.message("inspection.warning.single.character.alternation.in.regexp"), new SingleCharAlternationFix(text)); }