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

What is the GREP code to select the first 2 words and the space afterwards?

Tagged: ,

Return to Member Forum

  • Author
    Posts
    • #116971
      Year 1917
      Member

      hi

      what is the GREP code to select the 2 first words and the space afterwards of a paragraph?

      thanks

    • #116974
      Jeremy Howard
      Participant

      While this is certainly possible through GREP, the more simple solution would be to use nested styles. Apply character style x through 2 words.

      That being said, this would be the GREP string to use:

      ^(\<.*?\>){2}

    • #116992
      Year 1917
      Member

      thanks jeremy!

      the reason i cannot do it via nested styles is cause i wanna put a anchored object after the second word.

      thanks

    • #117055
      Year 1917
      Member

      thanks jeremy!

      i just tried your code, however it selects the first 2 words of each paragraphs even in a case that there is numbering (i want that it should select the first 2 words even when the first word is not a word just a number (example: “1) hello” and not “1) hello jeremy”).

      thanks

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