} (Right Curly Bracket) is ASCII code point 125 (0x7D), Unicode U+007D, and a printable punctuation character. It closes a grouped enclosure — the counterpart to {, it marks the exact point where a block of code, a JSON object, or a scoped declaration ends and control returns to the surrounding context. In block-scoped languages, } is the line that determines the lifetime of variables, the reach of a loop, and where a function's responsibility stops. Entire screens of C or Java can consist of nothing but closing braces at decreasing indentation levels, each one unwinding a layer of nesting. CSS rules, Rust match arms, Go function bodies — they all terminate here. In Bash, } closes brace expansions and function definitions but demands a semicolon or newline before it when ending a group command ({ cmd1; cmd2; }), a syntactic quirk that produces cryptic parse errors if you omit that final semicolon. The deeper gotcha involves scope confusion in JavaScript: a } closing a block inside a switch statement doesn't prevent fall-through between cases, and developers who assume the brace ends execution flow the way it does in an if block discover unexpected behavior when multiple cases run sequentially. Like its opening partner, the right curly brace was part of Bob Bemer's additions to ASCII, arriving in the 1960s as part of a matched pair. UTF-8 encodes it as a single byte 0x7D. Unicode classifies it as Pe (Punctuation, Close) with the name RIGHT CURLY BRACKET. The fullwidth } (U+FF5D) exists for CJK compatibility, and the mathematical right curly bracket in some typesetting systems is a separate glyph — neither will satisfy a JSON parser expecting the byte 0x7D.
const char *json = "{\"ok\":true}";const char *end = strrchr(json, '}');// Find the closing brace for a quick sanity checkif (!end) puts("missing } in JSON");
Almost never independent. } closes code blocks, object literals, template literal expressions (${...}), and string interpolation in various languages. The only exception is regex quantifiers: {3} means 'exactly 3 times', and {2,5} means '2 to 5 times.' But even there, { must come first.
In most regex flavors, { and } only have special meaning in quantifier context ({n}, {n,m}). A lone } is treated literally. But for clarity and portability, escape them: \{ and \}. This ensures your regex works across different engines (JavaScript, Python, PCRE).
This error means there's a closing brace without a matching opening brace. Common causes: accidentally deleted the opening {, wrong nesting level, or a missing statement between { }. Code editors with bracket matching and rainbow colorization help visualize brace pairs.
In C-like languages, single-statement blocks don't require braces: if (x) doThing(). But this is widely considered dangerous — adding a second line without adding braces creates the 'goto fail' bug (Apple's infamous SSL vulnerability). Most style guides mandate braces for all blocks.