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

GREP styles to find and bold names

New Here ,
Aug 28, 2020 Aug 28, 2020

Copy link to clipboard

Copied

I'm a newbie using InDesign GREP styles and I'm trying to find out a way to bold names on rally competition results. It's not an option to bold all the names manually because it would take ages. Is there a way to do it with GREP Styles? Here's an imaginary exampe of the text on the results, notice that the whole list is on the same paragraph to save space.

1.) Harry Stones, Rallyclub Newcastle, 47.14,8, Ben Williams, Mercedes Benz 190 E 2.3-16 (W201) 2.) Tom Wood, NameOfTheClub, 41.24,3, David Cave, Skoda Fabia R5 3.) Mike Evans, London Motorsport, 31.08,7, Philip Fox, Opel Astra f Gsi

 

Thanks!

TOPICS
How to , Scripting

Views

383

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

Community Expert , Aug 28, 2020 Aug 28, 2020

I think you need two grep styles to be added, as follows

\d+\.\)\s+\K(.*?),
\d+\.\) +.*?,(.*?,){3} +\K([^,]+)

This works for your example, see screenshot

Screenshot 2020-08-28 at 2.14.11 PM.png

-Manan

Votes

Translate

Translate
Participant ,
Aug 28, 2020 Aug 28, 2020

Copy link to clipboard

Copied

hi, try this:

(?<=\d\.\)\s)\w+\s\w+

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
New Here ,
Aug 28, 2020 Aug 28, 2020

Copy link to clipboard

Copied

Thanks! This helped me to bold names of the drivers (in the example Harry Stones, Tom Wood and Mike Evans) but it doesn't bold the codrivers (in the example Ben Williams, David Cave and Philip Fox). Is there a way to bold these as well?

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
Participant ,
Aug 28, 2020 Aug 28, 2020

Copy link to clipboard

Copied

sorry, didn't see them )))

new grep:

(?<=(\d\.\)\s)|(\d,\s))\w+\s\w+

 

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 ,
Aug 28, 2020 Aug 28, 2020

Copy link to clipboard

Copied

Smart indeed, or should I say I over-complicated and over-engineered the solution 🙂

-Manan

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 ,
Aug 28, 2020 Aug 28, 2020

Copy link to clipboard

Copied

I think you need two grep styles to be added, as follows

\d+\.\)\s+\K(.*?),
\d+\.\) +.*?,(.*?,){3} +\K([^,]+)

This works for your example, see screenshot

Screenshot 2020-08-28 at 2.14.11 PM.png

-Manan

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
New Here ,
Aug 28, 2020 Aug 28, 2020

Copy link to clipboard

Copied

Wow thank you Manan! This one is working 🙂 

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 ,
Aug 30, 2020 Aug 30, 2020

Copy link to clipboard

Copied

LATEST

\u[\w\h-]+(?=,\h\D)

 

(^/)  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