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

GREP Help for Name Breaks

New Here ,
Jan 27, 2021 Jan 27, 2021

Copy link to clipboard

Copied

Hi I'm relatively new to InDesign and have a GREP question. I have a list of hundreds of names that are separated by a semicolon. There isn't a consistent first, middle initial last pattern to the names as they are part of dedication so you can have individual names and family names, etc. As an example, a group of name can appear as:

 

First M. Last; First Middle Last; First Middle Hypenated-Last; First M Last; The Last Family; First and First Last; First & First M. Last

 

I'm trying to prevent the names from breaking to the next line before the semicolon so that a first name isn't on one line and the last name on a second line. I've attempted to grep between the semicolons and applying a nobreak style to the results (among a half dozen other things) to no avail. Could anyone point me in the right direction on how to accomplish this?

TY!

 

 

TOPICS
How to , Scripting

Views

345

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 , Jan 27, 2021 Jan 27, 2021

In a find/replace use this:

;\h\K.+?(?=;)

Votes

Translate

Translate
Community Expert ,
Jan 27, 2021 Jan 27, 2021

Copy link to clipboard

Copied

Try with this to apply a [No Break].

(?<=;\h).+?(?=;|$)

 

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 ,
Jan 27, 2021 Jan 27, 2021

Copy link to clipboard

Copied

Hi @Jean-Claude Tremblay no luck. It's similar to the issues I was having, which is it finds the first match and then stops searching.

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 ,
Jan 27, 2021 Jan 27, 2021

Copy link to clipboard

Copied

I see...

It’s working in a GREP Style.

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 ,
Jan 27, 2021 Jan 27, 2021

Copy link to clipboard

Copied

LATEST

In a find/replace use this:

;\h\K.+?(?=;)

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