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).
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).