Applying Character Style GREP with forced line break

Home Forums General InDesign Topics Applying Character Style GREP with forced line break

This topic contains 2 replies, has 2 voices, and was last updated by  Remy Grondin 4 days, 8 hours ago.

  • Author
    Posts
  • #111404

    Remy Grondin
    Member

    Hi!

    I’m trying to apply a GREP to a character style so that it put in bold everything from the beginning of the paragraph up to either a , or a /.

    My GREP looks like this: .+?(?=[\,|\/])

    It works perfectly… as long as there is no forced line break in my paragraph. If that’s the case, InDesign just start to apply the GREP to the lines after the forced line break as if it was the beginning of a new paragraph.

    I’ve tried nested styles and they do the same thing.

    How can I force my GREP to stop at the first occurrence of a , or a / AND at the first forced line break?

    That would be a cleaner solution than the workaround I’d use (manually «unbold» the next lines of text).

  • #111411

    David Blatner
    Keymaster

    Whenever you are trying to apply a style from the beginning of a paragraph, nested styles is going to be easier. In this case you would make the nested style go to ,/ (if you replace the word “Words” with your own characters, the style spans to whichever one character it finds first.

    This works fine for me, even if there is a line break in the paragraph. But note that a line break is a Shift-Return. If you choose Type > Show Hidden Characters, the line break should look like an “L” on its side (not the ¶ character).

  • #111413

    Remy Grondin
    Member

    That works! I didn’t realize you could assign multiples characters to nested styles!

    Thanks!

You must be logged in to reply to this topic.