Take the 2-minute tour ×
Graphic Design Stack Exchange is a question and answer site for Graphic Design professionals, students, and enthusiasts. It's 100% free, no registration required.

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?

share|improve this question

1 Answer 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.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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