Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

GREP to apply subscript to uppercase single character followed by a single digit

Enthusiast ,
Aug 01, 2025 Aug 01, 2025

I'm sure to have already asked this but I cannot find it anywhere, nor on search engines. 

In a music-related text, I need to show the octave of a note with a subscript digit. 

So, the middle-C on the piano would be C3 with 3 being subscripted. 

I am trying this GREP but it's not working:

(?<=[A-G])\d

 

This should be positive lookbehind for uppercase letters A to G, then applying the character style to the single digit following it. 

 

Any idea why this may not be working? 

Thank you!

TOPICS
How to
191
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 2 Correct answers

Community Expert , Aug 01, 2025 Aug 01, 2025

It works perfectly for me. Are you sure that the character style you apply via the GREP syntax is properly set? 

Capture d’écran 2025-08-01 à 22.07.47.pngCapture d’écran 2025-08-01 à 22.08.01.png

Translate
Community Expert , Aug 01, 2025 Aug 01, 2025

I don't know what happened, but I just re-typed the full string of your GREP style it it works now. 

Capture d’écran 2025-08-02 à 00.52.36.pngCapture d’écran 2025-08-02 à 00.52.49.png

Translate
Community Expert ,
Aug 01, 2025 Aug 01, 2025

It works perfectly for me. Are you sure that the character style you apply via the GREP syntax is properly set? 

Capture d’écran 2025-08-01 à 22.07.47.pngCapture d’écran 2025-08-01 à 22.08.01.png

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Aug 01, 2025 Aug 01, 2025

Here is the Character Style  (there is nothing else needed but Subscript):

Screenshot 2025-08-01 alle 22.17.44.png

And here is the Paragraph Style's GREP page:

Screenshot 2025-08-01 alle 22.18.03.png

And here is the result I get (that is, nothing): 

Screenshot 2025-08-01 alle 22.19.53.png

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Aug 01, 2025 Aug 01, 2025

If you want to check with a sample document, I have pasted some of the offending text in the attached InDesign file below.

Thanks!

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Aug 01, 2025 Aug 01, 2025

I don't know what happened, but I just re-typed the full string of your GREP style it it works now. 

Capture d’écran 2025-08-02 à 00.52.36.pngCapture d’écran 2025-08-02 à 00.52.49.png

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Aug 02, 2025 Aug 02, 2025
LATEST

Woah! That worked for me too! 

Unbelievable but, as a Jedi Master would say, "that's why you failed"! 😂

Thank you!

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines