For AI agents: the complete documentation index is available at /en/llms.txt, the full documentation bundle is available at /en/llms-full.txt, and this page is available as Markdown at /en/guide/text/brace-expander.md.
  • English
  • Brace Expander

    Brace Expander is for the case where one rule has to yield nine names or a hundred: a database migration that needs 100 field names, a batch of URLs, renamed files, or the contents of a SQL IN (...). Write the rule once; it lists every combination.

    The syntax is bash brace expansion, so the output matches bash line for line — whatever you can verify in a shell, you get the same here.

    Brace Expander interface

    30-second quickstart
    1. Write one line in the Template box, e.g. f{1..4}pd_ever_od30_{tag,bal}
    2. Not sure of the syntax? Click a syntax chip below the template (Range / Zero-pad / Step / Letters / List) to insert the snippet at the cursor
    3. All eight names appear live on the right; in the empty state, a set of example cards (template plus the first few results) fills the template on click
    4. Copy or export. To wrap into SQL / JSON / a comma list, click a format preset under Output assembly

    Layout

    Two panes:

    • Left, Template: template box, syntax chips, output order, output assembly, saved templates — with Save current template and Clear all at the top right
    • Right, Result: live output and item-count badge, Copy / Export, example cards in the empty state, and a notice when the expansion exceeds the limit

    Template syntax

    One template per line; several lines concatenate in order and each expands on its own. Braces inside a line expand:

    FormMeaning
    {1..100}integer range, 1 through 100
    {1..100..2}with a step: 1, 3, 5 …
    {001..100}zero-padded to three digits
    {a..e}letter range, same rules as integers, steps too: {a..c..2}
    {tag,bal}list
    \{ \} \,literals, backslash consumed: a\{b,c\}d → a{b,c}d

    Zero-padding takes its width from the literal width of the start value; the end never shrinks it: {001..10} gives 001 … 010. Whether you want f001 or f1 is yours to write in the template.

    Blank lines in a multi-line template produce no empty results; each line's braces expand independently.

    Several groups combine on their own

    Multiple brace groups form a Cartesian product without you writing one:

    f{1..2}_{tag,bal}   →   f1_tag  f1_bal  f2_tag  f2_bal

    Output order

    The template pane has an Output order switch deciding which brace group runs slowest:

    • Interleave (default, matches bash): {a,b}{1,2} → a1 a2 b1 b2, with the leftmost brace outer. f{1..2}_{tag,bal} gives f1_tag, f1_bal, f2_tag, f2_bal
    • Grouped: same template → a1 b1 a2 b2, with the rightmost brace outer, running all the way through before the left one advances. Use it when you need all the tags before all the bals

    Both modes produce exactly the same items; only the arrangement changes.

    Several template lines always concatenate in line order — the switch only applies to groups within a single line.

    Output assembly

    Output assembly wraps the expanded list into a common format. One click fills the line separator, prefix, and suffix (all three remain editable, and escapes such as \n and \t are supported):

    PresetLine separatorPrefixSuffixExample output
    Lines\n——one item per line
    Comma, ——a, b, c
    SQL IN', '('')'('a', 'b', 'c')
    JSON array", "[""]"["a", "b", "c"]

    The shape is prefix · line ⟨separator⟩ line · suffix. Common recipes:

    • Field names — template f{1..100}pd_ever_od30_{tag,bal}, assembly preset Lines
    • URL list — template https://example.com/{a,b,c}/{1..20}
    • Filenames — template img_{001..100}.png
    • SQL value list — template {1..100}, assembly preset SQL IN
    • JSON array — template {a..e}, assembly preset JSON array

    Template history

    Save current template puts the recipes you reuse into the history and pulls them back in one click later. The row stays off the first screen while the history is empty — it returns on its own after the first save. Click a history chip to load it; the × on the chip deletes it.

    Limits

    • The ceiling is 10,000 lines per run, a deliberate departure from bash, which has no limit. Past it, no partial result is produced; the reason is shown so you can narrow the range instead of shipping half a list
    • Grouped order is not bash behaviour — see above
    • An unclosed { is kept as literal text, and a hint appears below the template ("Unclosed { detected — kept as literal text"), so a missing closing brace is easy to spot
    • Typos stay literal. {a}, {1..} and {1..3.5} are not valid brace forms, so they come out exactly as written rather than raising an error, which makes a broken template obvious instead of silently short