• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Is there a Grep that will style everything after a certain word?

Explorer ,
Apr 09, 2019 Apr 09, 2019

Copy link to clipboard

Copied

Hi. I need to make everything after and including the word "NOW" bold and a certain color. Is this possible. Thank you for any help!

Screen Shot 2019-04-10 at 5.12.52 PM.png

Views

3.2K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Guide , Apr 10, 2019 Apr 10, 2019

Hi,

I've always preferred the precision! …

(\bNOW\b)(.(?!\1))+$

Best,

Michel, for FRIdNGE

Votes

Translate

Translate
Guide ,
Apr 09, 2019 Apr 09, 2019

Copy link to clipboard

Copied

if you want to find everything, try this

\bNOW.+

but let us know if you don't want to find just everything after the word NOW

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Apr 10, 2019 Apr 10, 2019

Copy link to clipboard

Copied

Thanks so much Vladan!

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Apr 10, 2019 Apr 10, 2019

Copy link to clipboard

Copied

A nested style would have a better performance.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Apr 10, 2019 Apr 10, 2019

Copy link to clipboard

Copied

This is an interesting comment (and one I have never considered):

A nested style would have a better performance.

So here is my question for all of you GREP gurus on this thread: if you can accomplish the same task with either  nested styles (in the OP's example, three nested styles) or one nested GREP style—is there an advantage to going with nested vs GREP? Do nested styles have measurably better performance, apples to apples?

~Barb

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Valorous Hero ,
Apr 10, 2019 Apr 10, 2019

Copy link to clipboard

Copied

Barb,

I think the performance of GREP styles versus Nested styles has to be similar at the simple level. ID still needs to evaluate the paragraph they are part of for changes in conditions, words, phrases, etc.

Here's a short version of why I choose one versus the other.

If it can be done with a nested style, I'll do it that way. If for no other reason it is "dumb" logic. I only really use nested styles for lead-ins, simple changes to the appearance of a repeated word or phrase, etc.

If I need to find a pattern(s), then I will use GREP styles. Especially if there are more than single logic statements needed.

Else I'll use f/c (where GREP may/will be involved) or cobble together a script if I have to.

Mike

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Sep 17, 2023 Sep 17, 2023

Copy link to clipboard

Copied

Can it search for certain words?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Sep 17, 2023 Sep 17, 2023

Copy link to clipboard

Copied

Grep can find words, Nested Styles cannot. If you enter a word into the nested style trigger field it will trigger on any character in that word.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guide ,
Sep 17, 2023 Sep 17, 2023

Copy link to clipboard

Copied

Hmm! ... Writing "Nested styles don't find words (one or more)" doesn't seem really true to me at the very least.

But it's a personal point of view!  😉

 

Capture d’écran 2023-09-17 à 16.07.35.png

 

(^/)  The Jedi

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Sep 17, 2023 Sep 17, 2023

Copy link to clipboard

Copied

LATEST

Nested styles can COUNT words, but cannot tell what those words are, which would be required to FIND them.

If youo need to do something to a particualr word, or befor or after a particular word, nested styles can oly work if there is a fixed pattern to the location of that word that can be identified, such as it is the third word in the second sentence, or the fifth word after the second comma. You cannot say apply [myStyle] up to the word "cat" as it will trigger on the first c, a or t that it finds, not the word "cat".

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Apr 10, 2019 Apr 10, 2019

Copy link to clipboard

Copied

Hi epheweAll ,

that would be a positive look behind for the word:

(?<=\bNOW).+

If you don't like to include the white space after the word:

(?<=\bNOW\s).+

Depending how often the word NOW is used in the paragraph we need a more precise approach.

Regards,
Uwe

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guide ,
Apr 10, 2019 Apr 10, 2019

Copy link to clipboard

Copied

Hi Uwe,

epheweAll wants to include the word NOW

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Apr 10, 2019 Apr 10, 2019

Copy link to clipboard

Copied

Ah yes. Did not have my morning coffee…

Thanks, Vladan!

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Apr 10, 2019 Apr 10, 2019

Copy link to clipboard

Copied

Thanks for your help Laubender!

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Apr 10, 2019 Apr 10, 2019

Copy link to clipboard

Copied

Another approach, which is just a variation:

.+\KNOW.+

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guide ,
Apr 10, 2019 Apr 10, 2019

Copy link to clipboard

Copied

Hi,

I've always preferred the precision! …

(\bNOW\b)(.(?!\1))+$

Best,

Michel, for FRIdNGE

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Apr 10, 2019 Apr 10, 2019

Copy link to clipboard

Copied

Thanks Michel! Works great. Cheers

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Apr 10, 2019 Apr 10, 2019

Copy link to clipboard

Copied

Sorry to bother you again @Michel [FRIdNGE]. Do you know if theres a way to continue this through a paragraph and ONLY style the word "NOW" and the price "$123" as seen in photograph? Thanks again for any help!

Screen Shot 2019-04-11 at 8.59.14 AM.png

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guide ,
Apr 10, 2019 Apr 10, 2019

Copy link to clipboard

Copied

NOW \$\d+(\.\d+)?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Apr 10, 2019 Apr 10, 2019

Copy link to clipboard

Copied

Thank you again @Michel [FRIdNGE] ! Damn you are good at this

This has saved me!

Cheers

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Apr 10, 2019 Apr 10, 2019

Copy link to clipboard

Copied

epheweAll  wrote

Sorry to bother you again @Michel [FRIdNGE]. Do you know if theres a way to continue this through a paragraph and ONLY style the word "NOW" and the price "$123" as seen in photograph? Thanks again for any help!

Screen Shot 2019-04-11 at 8.59.14 AM.png

Hi,

somehow I already thought this question would come up. 🙂

FWIW: Learn about GREP.

Try to analyze the text you like to find. Look at diverse samples in your text. Ask yourself if something can be said generally of the text or at least chunks of it.

Read into GREP land e.g. here:

Peter Kahrel | GREP in InDesign, 3rd Edition

https://indesignsecrets.com/now-available-grep-in-indesign-3rd-edition.php

Use tools that help to understand found patterns like this free script:

Jongware's whatthegrep script

Indesign GREP Help

Regards,
Uwe

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Apr 10, 2019 Apr 10, 2019

Copy link to clipboard

Copied

Thanks again Laubender​ for all the info. I'll look into it.

Have a great day!

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Apr 10, 2019 Apr 10, 2019

Copy link to clipboard

Copied

Thanks @Stephen_A_Marsh!

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Apr 10, 2019 Apr 10, 2019

Copy link to clipboard

Copied

Hi epheweAll

Just because no one has said it yet:

Whether you go with GREP or nested styles, you will need to create paragraph and character styles.

  • For GREP, you go to the GREP part of the paragraph style and put in the code, then assign the character style.
  • For nested styles, you say “use this character style until it meets this condition”, then use the paragraph style.

This is over-simplified, and you may know it already, but others may also come across this with a Search. We can explain in greater detail if necessary.

Jane

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines