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

Limit scope of GREP String

Return to Member Forum

  • Author
    Posts
    • #79092
      mdt34
      Member

      Hi friends,

      I’m trying to use GREP in a paragraph style. I need it to make a series of numbers that appear at the beginning of the paragraph bold (8.11.4 Any indemnification under Subsections 8.11.1 and 8.11.2). The problem I’m having is that I need to limit it to just the numbers at the front of the paragraph.

      How do I limit the scope of the GREP string to just the first set of numbers? This is the string I am using now: \d+

      Thank you for your help.

      Mike

    • #79099
      David Blatner
      Keymaster

      If you put a caret ^ at the beginning, it means “at the beginning of the paragraph.”
      So ^\d+? should find a string of just numbers. And ^(\d|\.)+ would find a string of digits or dots.

    • #79100
      mdt34
      Member

      Thank you, David! The second option was exactly what I needed. GREP is so powerful, but difficult for me to wrap my little brain around.

    • #79123
      Roger Morgan
      Member

      There is a tremendous resource for learning about regular expressions at https://www.regular-expressions.info/quickstart.html

      Quite why InDesign users never use the term ‘regular expression’ or ‘regex’ like the rest of the world is one of life’s great mysteries!

    • #79170
      Peter Kahrel
      Participant

      Probably because in InDesign you enter them in the GREP tab of the Find/Change window, and it’s become a habit to referer to regexes as GREPS.

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