Welcome Dialog

Welcome to the Community!

We have a brand new look! Take a tour with us and explore the latest updates on Adobe Support Community.


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

115

Likes

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

Advocate , Jan 27, 2021 Jan 27, 2021
In a find/replace use this: ;\h\K.+?(?=;)

Likes

Translate

Translate
Advocate ,
Jan 27, 2021 Jan 27, 2021

Copy link to clipboard

Copied

Try with this to apply a [No Break].

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

 

Likes

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.

Likes

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

Copy link to clipboard

Copied

I see...

It’s working in a GREP Style.

Likes

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

Copy link to clipboard

Copied

LATEST

In a find/replace use this:

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

Likes

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