Find/Replace Abbreviation Formatting

Learn / Forums / General InDesign Topics / Find/Replace Abbreviation Formatting

Tagged: ,

Viewing 3 reply threads
  • Author
    Posts
    • #93171
      Audra Allen
      Member

      Hi, I’m trying to write a GREP style for the Find/Replace function to ensure consistent formatting of abbreviations in my document. For example, in some places, the abbreviation “PE” appears “P.E.” I was able to fix these with the following GREP expression:

      Find: ([\l\u])[.]([\l\u])[.]
      Replace: $1$2

      However, for other abbreviations, such as “C.F.M.” or “C.P.S.M.”, this code doesn’t work. Is there a way to modify the expression so it finds any length abbreviation, or do I need to conduct a separate search for each with an expression that looks for each specific length?

      Thanks!

    • #93202
      Chad Beery
      Participant

      Use this code “\b([\l\u](\.)){2,}” to find and apply a character style, then look for any periods that have the character style applied to them and replace with nothing to delete them.

    • #93335
      Audra Allen
      Member

      Thank you, Chad!

    • #93425
      Masood Ahmad
      Participant

      Either way you can try this as well:

      GREP Find/Change:
      Find What: (\u)(\.)+?
      Change to: $1

      I see that the acronyms in your text are all uppercase. If yes, then give it a try…

Viewing 3 reply threads
  • You must be logged in to reply to this topic.
>