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

Is it possible to find the end of line with grep?

Return to Member Forum

  • Author
    Posts
    • #64492

      Maybe I am completely overlooking this feature but it would be nice to be able to search for the last word in a line. Is it possible?

      I am running this script that takes references out of the flow and places them in an anchored frame.

      This is sometimes causing some trouble and general weirdness.

      If the last word in a line is preceded by an anchored object some of that last word gets pushed out of the text frame. Not every time but enough to be quite annoying. The solution right now is to manually look for these occurences and move the space preceding the anchored object after the anchored object. Then everything is fine again.

      Please see attached screenshots of before and after moving the space:

      Before:

      Before

      After:

      After

      A weird bug right?

      So my question now is if a grep search can find a space followed by an anchor marker and the last word in a line and swap the space and the anchor marker around.

      I appreciate any thoughts on this.

    • #64498
      Eugenyus
      Member

      Another solution is to place Hair Space between the space and the anchor marker:

      Find What: s(?=~a)

      Change To: $0~|

    • #64500

      Thanks, Eugenyus

      Yes that kind of works.
      But it does not work very well in paragraphs where hyphenation is off. I get some very short lines now because of some words being pulled down to the next line. Is the hair space a non breaking character?

      I would still like to be able to swap the anchor marker and the space before it. That gives me the best result in all situations here.

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