Mobile app version of vmapp.org
Login or Join
Si6392903

: How to make GREP match everything between two markers, regardless the Forced Line Brake occurance I'm wondering if it's possible to make GREP "jump over" the Forced Line Brake (FLB), while he

@Si6392903

Posted in: #AdobeIndesign #CharacterStyles #Grep

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?

10.01% popularity Vote Up Vote Down


Login to follow query

More posts by @Si6392903

1 Comments

Sorted by latest first Latest Oldest Best

 

@Turnbaugh909

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.

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme