void (RegExpNamedGroupRef groupRef) { super.visitRegExpNamedGroupRef(groupRef); final RegExpGroup target = groupRef.resolve(); if (target == null) { return; } final RegExpBranch branch = PsiTreeUtil.getParentOfType(target, RegExpBranch.class); if (!PsiTreeUtil.isAncestor(branch, groupRef, true) && !isPcreCondition(branch)) { final String message = RegExpBundle.message("inspection.warning.group.back.reference.are.in.different.branches", groupRef.getGroupName()); myHolder.registerProblem(groupRef, message); } else if (target.getTextOffset() > groupRef.getTextOffset()) { final String message = RegExpBundle.message("inspection.warning.group.defined.after.back.reference", groupRef.getGroupName()); myHolder.registerProblem(groupRef, message); } }