Skip to main content
dublove
Legend
July 1, 2026
Answered

How does InDesign Grep represent groups greater than 9?

  • July 1, 2026
  • 2 replies
  • 27 views

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

 

    Correct answer Eugene Tyson

    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.

    2 replies

    Eugene TysonCommunity ExpertCorrect answer
    Community Expert
    July 1, 2026

    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.

    Community Expert
    July 1, 2026

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

    -Manan
    dublove
    dubloveAuthor
    Legend
    July 1, 2026

    It doesn't seem that flexible.