Skip to main content
Weeze92
Participant
November 22, 2018
Answered

InDesign help with GREP: superscripting a letter within a word

  • November 22, 2018
  • 2 replies
  • 526 views

I would like to change all instances of McAllan so the c is superscript.

Could anyone help me with how to do this within in Find/Change GREP, please, rather than doing it all manually?

Many thanks!

This topic has been closed for replies.
Correct answer vladan saveljic

find:

M\Kc(?=Allan)

change:

format superscript

2 replies

Colin Flashman
Community Expert
Community Expert
November 22, 2018

Sure, that can be done. Make sure you have a superscript character style already set up as desired, and in your GREP styles, use the following:

(?<=M)c

note that this will catch ALL instances of the following letter pair: uppercase M, lowercase c (Mc) but that combination - in English - is only really used in names, and not mid sentences, such as comcast where both letters are lowercase. However, if you want to ensure this only affects the start of words that have Mc, use the following GREP code:

(?<=\<M)c

I currently use similar GREP styles like this to sanitise databases where - while the names had been title-cased, they'd done so without taking into account names such as:

McMurray;

O'Driscoll;

I've written about it in more depth here: https://colecandoo.com/2012/08/08/no-fills-grep-styles-part-1/

If the answer wasn't in my post, perhaps it might be on my blog at colecandoo!
vladan saveljic
vladan saveljicCorrect answer
Inspiring
November 22, 2018

find:

M\Kc(?=Allan)

change:

format superscript

Weeze92
Weeze92Author
Participant
November 22, 2018

Thank you so much - it worked! :-)