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 apply style after third tab

Return to Member Forum

  • Author
    Posts
    • #34263

      Hello

      Just getting into GREP, and I have what is hopefully an answerable query!

      I want to apply a page-number character style to any character after the third tab in my contents page paragraph style.

      Any assistance much appreciated!

    • #34266
      Justin Sligh
      Member

      Matthew,

      You would need to do a positive look-behind to search for the three tab characters and then use a .+ for any number of characters after.

      (?<=).+

      (?<=) Positive Look-behind
      Tab Character
      . Any character
      + One or more of the previous

      This should do the trick.

    • #34432

      Hi there

      Many thanks, this worked a treat.

      I had actually found another solution that makes the most of the fact that the numbers are always at the end of a line for the ToC. So this bit of grep could be used to assign a style to digits only at the end of a line…

      \d+$

      Hope this little thread is useful to someone else out there.

      best regards

      • #34451
        Justin Sligh
        Member

        Matthew,

        You can apply a character style to page numbers and leaders within the table of contents style (Layout > Table of Contents Style..). This can be done separately for each TOC entry. Are you using an automated table of contents or were you creating it manually?

        Your expression would still prove useful if you included section markers within your page numbers and you wanted to style the letters and numbers differently (e.g., A1, A2, A3, B1, B2, B3).

    • #34458

      You are right Justin, this ToC ended up being made manually though… and thanks for the advice on how expression coudl still be useful.

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