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 to replace long row of periods with tab

Return to Forums

  • Author
    Posts
    • #52169
      Josh Freeman
      Member

      Just got a document where the author uses long series of periods instead of a tab with leader dots — all series are different lengths, of course. I'd love to replace these all at once with a nice simple tab character. Not being much a grep expert….can't figure out how to do this. Anyone know?

    • #52170

      A quick GREP primer: One-or-more is +. Any character is . so it's not a good idea to use this … Put a ackslash before it to make it literal: \. That makes the search expression

      \.+

      and you should replace it with a simple tab:

      Now hold on before you run off: that one-or-more means that a single period will also be replaced by a tab. I bet that's not what you had in mind, so let's make sure it only works with, say, 3 or more. This, instead, would work

      \.\.\.+

      but you can go for a fancy notation as well:

      \.{3,}

      No need for a plus! The {3,} part means: at least three times and an unlimited max (as there is no number given). (Some useful variants could be {3} to only find sets of 3 periods, or {3,5} to only find sets of 3, 4, and 5 periods.)

    • #52171
      Josh Freeman
      Member

      I had managed to get most of the way myself, if turns out. But it wasn't working right. I thought it was the GREP I was creating, but it seems there must have been some other weird characters in there. I ended up replacing their mess by hand. it's fine. And (as usual) I learned a lot in the process. Always a good thing. 

      Thanks!

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