diff --git a/RegExpSupport/src/org/intellij/lang/regexp/intention/CheckRegExpForm.java b/RegExpSupport/src/org/intellij/lang/regexp/intention/CheckRegExpForm.java index 88fc00e54426..c84b86aeeed7 100644 --- a/RegExpSupport/src/org/intellij/lang/regexp/intention/CheckRegExpForm.java +++ b/RegExpSupport/src/org/intellij/lang/regexp/intention/CheckRegExpForm.java @@ -518,11 +518,12 @@ public final class CheckRegExpForm { setMatches(regExpFile, collectMatches(matcher)); return RegExpMatchResult.MATCHES; } - else if (matcher.find()) { + final boolean hitEnd = matcher.hitEnd(); + if (matcher.find()) { setMatches(regExpFile, collectMatches(matcher)); return RegExpMatchResult.FOUND; } - else if (matcher.hitEnd()) { + else if (hitEnd) { return RegExpMatchResult.INCOMPLETE; } else {