GREP: locate last tab in a paragraph

Learn / Forums / General InDesign Topics / GREP: locate last tab in a paragraph

Viewing 8 reply threads
  • Author
    Posts
    • #102200
      dmancini
      Participant

      Hi,

      I would like to replace the last tab in each paragraph with a right indent tab.

      Thanks in advance

    • #102201
      Ward Baxter
      Member

      search for: \t$ and replace with ~y

    • #102221
      dmancini
      Participant

      Thanks for the reply, but it doesn’t find anything because the last tab and the end of paragraph are not consecutive.

      The structure of the paragraphs is this one.

    • #102225

      Try this one:

      Find what: \t([^\t\r]+)$
      Change to: ~y$0

      Kai

    • #102226
      dmancini
      Participant

      Thanks Kai, but it adds the right indent tab before the last tab, without removing it.

    • #102227

      Haha, thats true, cause in $0 everything is saved and insert again. Choose $1 instead of $0. Does it work?

      Kai

    • #102228

      \t(?=[^\t]*$)
      ~y

      Best,
      Michel, from FRIdNGE
      [email protected]

    • #102229

      Haha, Michel thanks. I tried this one and it won’t work in my case this morning. I assume, that I put the $ outside the parantheses.

    • #102230
      dmancini
      Participant

      Thanks Kai and Michel, both solutions work.

Viewing 8 reply threads
  • You must be logged in to reply to this topic.
>