0

I'm wondering if it's possible to make GREP "jump over" the Forced Line Brake (FLB), while he is searching for particular keyword.

I have a text frame containing multiple Companies described by three categories:

    1. Company's Name
    2. Website
    3. Short Description.

Every category is marked in the text by it's marker (a keyword) on the beginning of it:

    MARKER1 Dreamworks Studios [FLB]
    MARKER2 www_dreamworks_xxx/info/info [FLB]
    MARKER3 company that produces movies [PR]
    MARKER1 Coca-Cola Company [FLB]
    MARKER2 www_cocacola_xxx/info/info [FLB]
    MARKER3 company that produces drinks [PR]
    ...etc.

Now, each of those three categories should have separate CHARACTER STYLE applied with use of GREP. I want GREP to search trough the text till he finds specific marker and to apply desired STYLE to everything... untill the next marker:

    everything between MARKER1 and MARKER2 should get STYLE1
    everything between MARKER2 and MARKER3 should get STYLE2
    everything between MARKER3 and MARKER1 should get STYLE3

And that's quite easy... untill I have to use more FLB-s between markers:

    MARKER1 Dreamworks [FLB]
    Studios [FLB]
    MARKER2 www_dreamworks_xxx/ [FLB]
    info/info [FLB]
    MARKER3 company that[FLB]
    produces [FLB]
    movies [PR]
    ...etc.

When the text looks like above, all my concepts for GREP sentences fail. I stumbled here upon this useful sentence, which is good if the text looks like in the first example (without multiple FLB-s between markers), or if used with only one style and one category. Here is how I'm using it to apply STYLE1 to the part of text of first category:

Apply: 
    STYLE1
to Text: 
    ^.*?((MARKER2)|$)

But when I use similar sentence with next category (changing only the marker) it doesn't work properly. because of those additional FLB-s.

So I repeat my question: is it possible to make GREP "jump over" the Forced Line Brake (FLB), when it is searching for particular keyword?

1 Answer 1

-1

You need a conditional.

In pseudo code:

If this state is true (searching for your keyword) Then jump over FLBs

Else

Don't jump of FLBs

And probably put this in a loop so that it solves throughout the doc.

Apparently GREP has the ability to deal with conditionals... maybe.

1
  • In terms of logic - I agree with you. The same way I was approaching this problem. But HOW on Earth make this logic work in Indesign's GREP? I have been searching for GREP conditionals commands trough the web and nothing. I only got the "OR" command, which I have incorporated into my logic structure, and into GREP commands, but that haven't worked. Can You help me more directly? Which commands of GREP I should look up for this conditional searching? Or maybe there is another option? I was thinking about applying a set of 3 PARAGRAPH STYLES to a text frame (with "next style"). WhatDoYouThink?
    – micz
    Sep 20, 2014 at 22:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.