void (RegExpBoundary boundary) { super.visitRegExpBoundary(boundary); final RegExpBoundary.Type type = boundary.getType(); boolean unexpected = switch (type) { case BEGIN -> // \A hasUnexpectedSibling(boundary, false, false); case LINE_START -> // ^ hasUnexpectedSibling(boundary, false, true); case END /* \z */, END_NO_LINE_TERM /* \Z */ -> hasUnexpectedSibling(boundary, true, false); case LINE_END -> // $ hasUnexpectedSibling(boundary, true, true); default -> false; }; if (unexpected) { myHolder.registerProblem(boundary, RegExpBundle.message("inspection.warning.anchor.code.ref.code.in.unexpected.position")); } }