({{, Check Balance
expands the selection to cover the nearest pair of matched bracketing characters. }})

OpenersNotesSection(Spacer1)Details

Check Balance selects nested expressions (for example, parenthesized) outward from the insertion point.

To select a nested expression, select anywhere within the expression by clicking. Choose Check Balance, and click to expand the selection out to the next set of enclosed parentheses, brackets, or braces.

Each time you choose Check Balance, the Wolfram System expands the selection in both directions until it finds pairs of matching parentheses, brackets, or braces. Repeating the command expands the selection one level at a time.

You can use the Check Balance command to check the structure of mathematical expressions. For example, if you have unbalanced parentheses or parentheses incorrectly balanced with brackets or braces, the Wolfram System beeps. Choose (MenuGrayLink[Help, paclet:guide/HelpMenu]) ▶ (MenuGrayLink[Why the Beep?, paclet:ref/menuitem/WhyTheBeep]) to identify the mistake. If you position the insertion point inside a bracketed expression and choose Check Balance, the Wolfram System should select the whole expression. If not, you have a missing bracket somewhere.

The Wolfram System cannot balance a selection that spans more than one cell.

Keyboard shortcuts: (Key2[shift, ctrl, b]) (Windows); (Key2[shift, cmd, b]) (Macintosh); (Key2[shift, ctrl, b]) (Linux).

({{DocumentationFooterIconsRelatedFunction.png, ({{See Also}, {(MenuGrayLink[Complete Selection, paclet:ref/menuitem/CompleteSelection])  ▪  (MenuGrayLink[Extend Selection, paclet:ref/menuitem/ExtendSelection])}, {Related Front End Tokens:  (RefLink[Balance, paclet:ref/frontendobject/Balance])}})}})

({{DocumentationFooterIconsRelatedGuide.png, ({{Related Guides}, {▪(RefLinkPlain[Edit Menu, paclet:guide/EditMenu])}})}})