This is documentation for Mathematica 5, which was
based on an earlier version of the Wolfram Language.
View current documentation (Version 11.2)

Documentation / Mathematica / Front End / Menu Commands / Edit Menu /

Check Balance

FilledSmallSquare Check Balance expands the selection to cover the nearest pair of matched bracketing characters. This command selects nested (e.g., parenthesized) expressions outward from the insertion point.

FilledSmallSquare To select a nested expression:

1. Select anywhere within the expression by clicking.

2. Choose Check Balance.

3. Repeat to expand the selection to the pair of enclosing parentheses, brackets, or braces.

FilledSmallSquare Each time you choose Check Balance, Mathematica 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.

FilledSmallSquare You can use the Check Balance command to check the structure of mathematical expressions. If you have unbalanced parentheses, for example, or parentheses incorrectly balanced with brackets or braces, Mathematica beeps. (Choose Why the Beep? to identify the mistake.) If you position the insertion point (blinking vertical bar) inside a bracketed expression and choose Check Balance, Mathematica should select the whole expression. If not, you have a missing bracket somewhere.

FilledSmallSquare Mathematica cannot balance a selection that spans more than one cell.

FilledSmallSquare Keyboard shortcuts: ShiftKey KeyBarControlKeyLeftModifiedb RightModified(Windows); ShiftKey KeyBarCommandKeyLeftModifiedb RightModified(Macintosh); ShiftKey KeyBarControlKeyLeftModifiedb RightModified(X).