GREP style after double line break

Learn / Forums / General InDesign Topics / GREP style after double line break

Tagged: 

Viewing 3 reply threads
  • Author
    Posts
    • #93806
      Jey Tee
      Member

      I would like to apply a GREP style to all words after a double line break (before the next line break). Basicly highlight all the titles in the document. What would be the code for that?

    • #93851

      I’m not a GREP expert, but I think the pattern for your GREP Style would be

      APPLY:
      Bold [character style selected from menu]

      TO TEXT:
      Line break, Line break, Any character repeated one or more times, Line break

      which in GREP-ese is \n\n.+\n

      I did a test over here and that seems to work. Does it for you?

    • #93852

      To be clear, this is what you’d edit in the *paragraph style’s* GREP Style panel. The paragraph style that you’ll be applying to the paragraphs containing all the titles.

      It’s not a GREP Find/Change … but the same codes could work there.

    • #93860
      Peter Kahrel
      Participant

      GREP styles are defined inside a paragraph (or paragraph style). Which means that you’d first have to apply a paragraph style to those titles — in which case you don’t need a GREP style, you simply make the formatting part of the paragraph style. Also, Anne-Marie correctly wrote that you can look for \n, but that’s a forced line break. If those line breaks are paragraph breaks then you can’t use a GREP style.

      Why don’t you apply a paragraph style with a GREP find/change? Look for (?<=\r\r).+ and apply a paragraph style. And if you set space before in the paragraph style, you can remove those two line breaks (which you really should do): Find what: \r\r(.) Change to: $1 Change Format: </p> <p>Peter

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