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 shortcut

Return to Member Forum

  • Author
    Posts
    • #14366532
      Rich Harvey
      Participant

      Does anyone know of a GREP code that will seek out paragraphs that lack punctuation right before the paragraph break?

      Sometimes authors place an unnecessary paragraph break in the MIDDLE of a paragraph. It may look fine in word … but when placed in InDesign and formatted, sometime it becomes apparent where the unnecessary return is … usually AFTER I missed it in proofreading.

    • #14366534
      Dhafir Photo
      Participant

      Try this:[^.!?:~e]$

    • #14366535
      Rich Harvey
      Participant

      Dhafir, that works great, except that it flags any paragraph ending with quotation marks. Since this is a novel, with a considerable amount of dialogue, it stops on those as well. Would a slightly different GREP flag a paragraph that ends without punctuation AND quotation marks?

    • #14366536
      David Blatner
      Keymaster

      Rich, it’s probably helpful to know what Dhafir’s grep code does: Normally, characters inside square brackets mean “or”… like “a period or an exclamation point or a question mark, etc.… But the ^ at the beginning of the set here means “not”! And $ means the end of the paragraph. So this means “not any of those characters at the end of the paragraph.”

      Therefore, if you add quote marks to the list, it should work: [^.!?:"~e]$

    • #14366537
      David Blatner
      Keymaster

      (Should have added: the ~e code means an ellipsis character)

    • #14366548
      Rich Harvey
      Participant

      Dhafir and David!

      Thanks so much! Works like a charm! I am now happily fixing those “broken” paragraphs — and finding a handful of paragraphs with no ending punctuation, too boot!

    • #14366549
      Rich Harvey
      Participant

      Actually, I should add that using the built-in GREP queries for “Multiple space to single space” and “Remove trailing white space” are invaluable. Best to run either GREP (or both) before sending out the search party for the “broken” paragraphs.

    • #14366579
      Dhafir Photo
      Participant

      To delete multiple spaces and trailing space in one click try this:
      in Find: \r\K^+|+$|\K+
      in Change: Leave empty

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