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

GREP expression help

Return to Member Forum

  • Author
    Posts
    • #14402537
      Lindsey Engelhardt
      Participant

      Hi! I think what I’m trying to do can be accomplished through GREP, but I’m very new to it. I’m doing a data merge, and I want to add a GREP expression into my paragraph style to apply a bold character style to the department name as part of the data merge. Here’s some example text:

      “In Illinois, the Department of Health and Human Services serves as …”

      The state name will change for each state when I do the data merge, so I think the GREP expression needs to use the comma as it’s starting point and “serves as” as the ending point. How do I indicate the start and end points?

      Thanks so much!

    • #14402539
      David Blatner
      Keymaster

      Hi Lindsey! Great that you’re trying this. This might work:
      (?<=,).+?(?=serves)

      That searches for anything PRECEDED by a comma followed by a space, and followed by the word "serves"

      There are a ton of resources here:
      https://creativepro.com/resources/grep/

    • #14402562
      Lindsey Engelhardt
      Participant

      Thank you so much, David! That worked. Thanks also for the explanation of what the expression says and the resources. Now I have a GREP fishing pole.

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