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

Using GREP to select paragraphs that don't contain something

Tagged: 

Return to Member Forum

  • Author
    Posts
    • #103451
      Aaron Gray
      Participant

      Hey GREP gurus,

      I’m wondering if anyone might be able to help me out with this. I am trying to come up with a GREP expression that would select only paragraphs that do NOT contain this string: \(\u{2}

      In other words if a paragraph has an open parenthesis followed by two uppercase letters, I want my Find/Change to skip it and only select paragraphs that DON’T contain that string. I should probably also mention that this string would not be at the beginning or end of a paragraph, but somewhere in the middle.

      (The backstory on this is that I generate an index for a catalog and then I have to separate it out into two indexes: one for parts and one for manufacturers, and I’m trying to use GREP to delete all the entries that don’t belong in one of these indexes.)

      Thank you!
      Aaron

    • #103452

      Hi,

      Why not create 2 indexes?

      Best,
      Michel, from FRIdNGE

    • #103457
      Viktor Engárd
      Participant

      ^(?:(?!\(\u{2}).)*$\r?

    • #103458

      “… I should probably also mention that this string would not be at the beginning or end of a paragraph, but somewhere in the middle.”

      ;-)

    • #103459
      Robert Ole?
      Member

      You can use Conditional Text first.

      F: .*\(\u\u.+
      R: any condition

      and then select all unconditional text.

    • #103460

      In this game, I don’t participate! …
      I only count the tries! … =D

      So: 0 / 2*

      [only one regex allowed; 2 answers, no good answer]

      Best,
      Michel

    • #103461

      0 / 3 [on “The Treasures of Grep” FB page]

      To be continued! …

      Best,
      Michel

    • #103484
      Aaron Gray
      Participant

      Thank you, Viktor, Michael, and Robert, for the comments and suggestions. Viktor, that string did the trick. Thank you so much!

      Aaron

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