Skip to main content
January 19, 2017
Answered

InDesign GREP code help

  • January 19, 2017
  • 1 reply
  • 2517 views

Hello all,

In InDesign CS6 I'm dealing with a bunch of listings for a directory. Each listing requires multiple styles and I'm wondering what GREP code might be used, if possible, to get the job done.

An example listing reads as follows:

     NAME OF COMPANY                 

     Company address

     Company contact info

     Company phone number

     Booth(s): 2129

     Description of company.

This is how the final should appear:

I've already created the desired character styles.

I need to format the name of the company, which sometimes continues onto the second line,

and I need to format each line that starts with "Booth(s):...", which is followed by a sequence of numbers.

The rest can be styled as body copy.

Any advice on how to get this done? Thanks a lot!!

This topic has been closed for replies.
Correct answer Peter Kahrel

By the looks of it the company name is in all capitals. Are those caps real or is it lower case with AllCaps applied? If they're real capitals they're easy to find: ^\u\u+?$. If not, maybe the company name is the paragraph with two returns before it, which you find using

(?<=\r\r).+?$

The booths are easy to find: (?<=\n)Booth.+?\d$

P.

1 reply

Peter Kahrel
Community Expert
Peter KahrelCommunity ExpertCorrect answer
Community Expert
January 20, 2017

By the looks of it the company name is in all capitals. Are those caps real or is it lower case with AllCaps applied? If they're real capitals they're easy to find: ^\u\u+?$. If not, maybe the company name is the paragraph with two returns before it, which you find using

(?<=\r\r).+?$

The booths are easy to find: (?<=\n)Booth.+?\d$

P.

January 20, 2017

Everything worked no problem! Thanks so much for the help.

Cheers!