GREP to change style after "|"

Learn / Forums / General InDesign Topics / GREP to change style after "|"

Tagged: 

Viewing 3 reply threads
  • Author
    Posts
    • #93089
      Steve Quinn
      Member

      Ive got a list (its actually a table with each line in its own row in case that matters) that looks like the following:

      First Item | Then a description of varied length
      Another Item | Also with a description
      And One More Item | With one more description

      I want the text that precedes the ” | ” to have one style and the text that follows the ” | ” to have a different style

      is there a way to do this using GREP? ANd if so, what would the GREP look like.

    • #93099

      ^[^|]+\|

      Beginning of a para
      followed by a character, that is not “|”
      one or more times
      followed by a “|”

      Kai

    • #93116

      Really basically here, 2 Grep styles:

      .+(?=\h\|)

      \|\h\K.+

      (^/)

    • #93160
      Masood Ahmad
      Participant

      Hi Steve,

      Is it mandatory to use GREP in this scenario. This can simply be done using using the Nested Styles and you won’t have to run Find/Change every time.

      I hope you have the Paragraph Styles already in place. Just tweak the associated para style, something like this:
      Nested Styles:
      CharacterStyleForTheTextBeforePipeSignup to1|

      Please let me know if it works.

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