void (RegExpClosure closure) { super.visitRegExpClosure(closure); ASTNode token = closure.getQuantifier().getToken(); if (token == null || token.getElementType() != RegExpTT.STAR) { return; } PsiElement sibling = closure.getPrevSibling(); RegExpAtom atom = closure.getAtom(); if (sibling instanceof RegExpElement && atom.getClass() == sibling.getClass() && sibling.textMatches(atom) && !containsGroup(atom)) { final String text = atom.getUnescapedText() + '+'; myHolder.registerProblem(closure.getParent(), TextRange.from(sibling.getStartOffsetInParent(), sibling.getTextLength() + closure.getTextLength()), RegExpBundle.message("inspection.warning.can.be.simplified", text), new RegExpSimplifiableFix(text)); } }