Auto format a word with GREP Styles, Ignoring Capitalization and Accents
Someone wrote us recently asking about how to format a word with grep styles, but it had to ignore the capitalization and accents that may or may not appear in the word. This is tricky because GREP is very specific; if you search for “Aardvark” it will not find “AArdvark” or “Aàrdvark” or any other variation. But you can tell InDesign to be a little more flexible with some extra and somewhat obscure codes.
For example, let’s say you wanted to format the word NESCAFÉ® — but sometimes it has an accented final letter and sometimes it doesn’t; and sometimes it is just spelled Nescafe. Or perhaps it’s Citroën/Citroen, or Motörhead/MOTORHEAD, and so on.
So here are the two rules to remember:
- You can create a Grep Style (you’ll notice I am quite loose with my capitalization of GREp, too) that ignores capitalization by adding a
(?i)at the beginning. - You can search for any diacritical alternative of a letter by using the code
[[=a=]](but replacing the “a” with the letter you’re looking for)
So in the Nescafe example, you could search for: (?i)nescaf[[=e=]]~r?
(The tilde-r followed by the question mark means “there could be a registered trademark there, or perhaps not” — in other words, “zero or one ® symbols.”)
That would find Nescafe, Nescafé, NEScafÉ®, NESCAFE®, and so on…
This article was last modified on December 30, 2021
This article was first published on July 29, 2013
Commenting is easier and faster when you're logged in!
Recommended for you
Design How-to: A Better Newsletter
Newsletters. It seems that every organization has them, and few designers can es...
Using the Book Panel in InDesign
Learn how to use the Book panel to make any long-document project more manageabl...
Getting the Most Out Of Cross-References
Learn the ins and outs of this useful feature to take your reader anywhere you w...
