Back

If your email is not recognized and you believe it should be, please contact us.

  • You must be logged in to reply to this topic.Login

Need help with GREP

Return to Member Forum

  • Author
    Posts
    • #34330
      Elaine
      Member

      I want to use GREP style to italicize several different years in a document and they don’t all follow the same format.

      For example, I have:

      (1629-1676)

      (1676?82)

      and (431?404 B.C.)

      How do I do this?

    • #34332
      Jack Brannen
      Member

      Hi Elaine,

      I think I can help with this. First the query, then a translation. I have tested this in InDesign and it finds all three of your examples above. It should work for others as well.

      \(\d+(-|?|?)\d+( B\.C\.)?( A\.D\.)?\)

      The translation of this is:
      1. A literal open parenthesis
      2. Followed by one or more digits
      3. Followed by either a hyphen OR an en dash OR an em dash
      4. Followed by one or more digits
      5. Optional: followed by the string ” B.C.”
      6. Optional: followed by the string ” A.D.”
      7. Followed by a literal close parenthesis

    • #34334
      Elaine
      Member

      Thank you!

Viewing 2 reply threads
  • The forum ‘General InDesign Topics (CLOSED)’ is closed to new topics and replies.
Forum Ads