Skip to main content
dublove
Legend
Jul 1, 2026 9:09 AM UTC
Answered

How does InDesign Grep represent groups greater than 9?

For example:
Search: (A) (B) (C) (D) (E) (F) (G) (H) (I) (J) (K) (L) (M) (N)
Replace with: $1 ${12}
That is: AL

 

The actual result is as follows:
A${12}
It seems that ${12} is invalid

 

    Eugene TysonCorrect answer
    Community Expert
    Jul 1, 2026 9:49 AM UTC

    In InDesign GREP replacements, the captured found text only works from $1 to $9.

    So $12 is not treated as “capture group 12”. In many cases it is read as $1 plus the literal number 2, or ${12} is treated as plain text.

    So yes, this is basically a limitation.

    The workaround is to only capture the parts you actually need, and make the rest non-capturing groups.

    For example, instead of this:

    (A) (B) (C) (D) (E) (F) (G) (H) (I) (J) (K) (L) (M) (N)

    Use this:

    (A) (?:B) (?:C) (?:D) (?:E) (?:F) (?:G) (?:H) (?:I) (?:J) (?:K) (L) (?:M) (?:N)

    Then replace with:

    $1$2

    This gives:

    AL

    The important part is that only A and L are captured, so they become $1 and $2.

    4 replies

    Eugene TysonCommunity ExpertCorrect answer
    Community Expert
    Jul 1, 2026 9:49 AM UTC

    In InDesign GREP replacements, the captured found text only works from $1 to $9.

    So $12 is not treated as “capture group 12”. In many cases it is read as $1 plus the literal number 2, or ${12} is treated as plain text.

    So yes, this is basically a limitation.

    The workaround is to only capture the parts you actually need, and make the rest non-capturing groups.

    For example, instead of this:

    (A) (B) (C) (D) (E) (F) (G) (H) (I) (J) (K) (L) (M) (N)

    Use this:

    (A) (?:B) (?:C) (?:D) (?:E) (?:F) (?:G) (?:H) (?:I) (?:J) (?:K) (L) (?:M) (?:N)

    Then replace with:

    $1$2

    This gives:

    AL

    The important part is that only A and L are captured, so they become $1 and $2.

    Translate
    Community Expert
    Jul 1, 2026 9:37 AM UTC

    Send the indd document and show where and how this is being used?

    Translate
    -Manan
    dublove
    dubloveAuthor
    Legend
    Jul 1, 2026 10:35 AM UTC

    It doesn't seem that flexible.

     

    Translate