Intermediate Level GREP Workshop
Chad Chelius
Philadelphia, Pennsylvania
Fire Station 59, Training Facility,
2117 Butler Ave.,
Los Angeles, California 90025
May 16, 2019
7:00–10:00 p.m.
Have you ever had the need to search text in InDesign but find/change doesn’t cut it? Have you ever had to run multiple find/change routines to get what you needed? If so, you’ll want to know more about GREP in InDesign—which is essentially find/change on steroids. Although GREP is nothing new in InDesign, it’s definitely underutilized. Some people avoid GREP because it uses—dare it be said?—code. But it's friendly code and once you are familiar with it, you'll get to call yourself a Nerd. How cool is that?
With GREP you can perform intelligent searches on text to achieve amazing results. In addition to finding and changing text in an InDesign document, GREP can also be incorporated into styles to precisely format text elements in any way that you wish. If you use and like find/change, you'll love GREP.
Although this is an intermediate level presentation, everyone of all skills levels should come. Chad will still cover the basics, but move through them a tad quicker.
Meeting Notes
By Alvin Takamori
There's always something new. In May, the Los Angeles InDesign User Group met at the Los Angeles Fire Station 59 Training Facility in West Los Angeles. It was a nice meeting room with space for tables to sit behind and multiple video screens. Who knew such a facility was available to groups such as ours?
After a welcome and brief introduction by LAIDUG Co-Manager DeShawn Burton, Chad Chelius began his presentation. Chad is an Adobe Certified Instructor, a consultant, and an author from the Philadelphia area, who came all the way to L.A. for us… Okay, actually we were fortunate that he happened to be in town and agreed to come to our meeting.
His topic for the evening was InDesign GREP, which InDesign geeks know as General Regular Expression Parser. Many people avoid it because, they think of it as complicated computer coding. However, Chad described it in a way that made it more approachable. Most people are familiar with the Find/Change command, which can search through text for a specific item and alter it. GREP also searches through text to make changes, but it searches for more than an item, it searches for patterns within the text.
As Chad provided examples of how to use GREP, it became apparent how powerful this ability to search for patterns could be. His first example was a search to find numbers at the front of a numbered list. In GREP code, a number or digit is represented by a forward slash and the letter "d". So it is written as \d. The backslash \ is an important symbol that is used often in GREP code. \d represents a single digit, so a two digit number would be represented by \d\d. What if you had a really long number? You could keep writing multiple \d\d\d… or you could add a plus symbol +. In GREP code + means one or more. So, \d+ would mean one or more digits.
Continuing with his example, Chad pointed out that numbers in a list would typically have a period and a tab space after the number. However, in GREP code a period "." by itself represents "any character". So to actually represent a period in GREP, a backslash needs to be added \. A tab space is represented by \t. Therefore, to represent a number in a list, the GREP code is written as \d+\.\t
So \d+\.\t is a pattern. Being able to describe a pattern in GREP allows you to find it and alter it. In the GREP window, there's a box where you type in the pattern to look for and in another box you type in the pattern you want to change it to. For this example, you could convert the numbers to letters, change the indent space, or change the Style. You could even do all of these at once. That is the power of using GREP.
Chad showed a few more basic GREP symbols. A straight vertical line | means "or". For example, find cent(er|re) means find the word center or centre. In GREP code \u represents an upper case letter and \l represents a lower case letter. \s represents a space and \r represents a return, and ^ represents the beginning of a paragraph.
A powerful symbol in GREP code is the question mark ? which represents something that may or may not exist. This was useful when he showed us the GREP code to search for the various ways that people write phone numbers and change them all to one consistent format. The question mark is used to search for parenthesis, periods, or hyphens that may or may not exist. The item that may or may not be there is followed by the question mark. For example, \(? means an opening parenthesis that may or may not exist.
Brackets enclosing a series of code is one way to create a set of items and apply a GREP command to all the items. In the telephone example, [-.]? the brackets enclose a hyphen and a period. The following question mark? is applied to both items indicating a hypen or period which may or may not exist. So a telephone number in GREP would be symbolized as\(?(\d\d\d\)?[-.]?(\d\d\d)[-.]?(\d\d\d\d). To break it down, it means an opening parenthesis that may or may not exist \(? followed by a group of three digits (\d\d\d) followed by a closing parenthesis that may or may not exist \)? followed by a hyphen or period that may or may not exist [-.]? followed by a group of three digits (\d\d\d) followed by a hyphen or period that may or may not exist [-.]? followed by a group of four digits (\d\d\d\d)
In the telephone number example, parenthesis without a forward slash are used to form groups. In the GREP window, after creating a group in the search box you can represent the group in the "change to" box with a dollar sign and number. Going back to the telphone example, instead of rewriting (\d\d\d) in the change box you can represent the group by writing $1 So, to convert the various ways that people write phone numbers to a format where the groups of numbers are separated only by periods, you would take the code \(?(\d\d\d\)?[-.]?(\d\d\d)[-.]?(\d\d\d\d) and enter it in the search box but in the change to box, all you would have to write is $1.$2.$3
Chad provided another example, using GREP to take a list of names and changing it so that the last name is switched to the front. The pattern for a name is an upper case letter followed by one or more lower case letters. In GREP code that is written as (\u\l+). So to make the desired change, a search for names represented as (\u\l+)\s(\u\l+) would be changed to $2,$1 which represents last name followed by a comma, then first name.
Another interesting feature of GREP is the ability to search for a pattern, then look at what is in front of, or behind that pattern. You could then change those things in front or behind, without altering the pattern that you originally searched for. As an example, Chad created a search for text inside of parenthesis. In GREP code (?<=) means to look for something behind. The pattern you are searching for would be added inside the parenthesis after the equal sign. For Chad's example, he was looking for something after an opening parenthesis \( This would be represented by the following code (?<=\() A period . represents any character and a plus sign + would indicate one or more characters. (?=) means to look for something ahead or in front of. Once again the pattern you want to search for is added after the equal sign. For our example it is something in front of a closing parenthesis \), represented as (?=\)) So to search for any text inside of parenthesis, the code would be (?<=\().+(?=\)) You could then proceed to make whatever changes you want to the text inside of any parenthesis without altering the parenthesis themselves. Again, you are looking at what is after the opening parenthesis and in front of a closing parenthesis.
Chad also explained how GREP can be used to automate changing text using Character Styles and Paragraph Styles. He demonstrated this with an example searching for specific text to highlight. He also demonstrated how to evenly space text inside a row of boxes and how to highlight every other row of a list.
A major advantage of using GREP instead of Find/Change is that even if the text continues to be edited, the GREP commands will automatically be applied to any new text. On the other hand, a new Find/Change would have to be applied any time there is a change to the text.
The use of GREP is far easier to understand when you see the effect demonstrated, then it is for me to try to describe in words. There is a trial and error process in seeing what effect a GREP command actually has. However, even if you are uncomfortable with coding there's already a list of common GREP patterns pre-loaded in InDesign. GREP's ability to make significant changes through huge volumes of text, and to do so automatically, is potentially a huge time-saver that makes it worth exploring.
To learn more Chad recommended "Treasures of GREP" on Facebook or you can twitter him @chadchelius.
Farthest Attendee
The bona fide LAIDUG member who travels the farthest specifically to attend the meeting will receive her or his choice of any one deal at MightyDeals up to $50.00. Mighty Deals offers fonts, templates, apps, e-books, etc. You need to prove to us that you traveled farthest to attend this meeting. Having recently moved to the area from somewhere else won't cut it. Be prepared to show us indication of your current residence—perhaps a driver's license or a utility bill. Decision of the administrators of the Los Angeles InDesign User Group is final. Winner — Alejandro Rubalcava
Raffles
LAIDUG is supported by raffles of donated prizes. No one is required to participate in the raffles. Raffle tickets are: 1 for $3, 2 for $5, 5 for $10, 11 for $20, 24 for $40, 32 for $50 and 65 for $100. All major credit cards are accepted.
Special Raffle Prize
Beats by Dr. Dre Studio Over-Ear Black Headphones. Thick foam, which is washable, surrounds the ear cups to shut out external noise and highlight bass frequencies, without using any noise cancellation frequencies or other amplifications that might add distortion to the sound. Powerful enough to block out a jet engine. Powered by a pair of AAA batteries, the noise cancellation feature in a pair of Beats Studio headphones amplifies the music as it blocks out noise, giving you consistently powerful and intense sound. Winner — Alan Gilbertson
Raffle Prizes and Winners
Adobe Creative Cloud. 12 month subscription. Value $599.88 Winner — Susan Reuben
Collection of 24 Adobe software applications for graphic design, video editing, web development and photography including InDesign, Photoshop, Lightroom, Illustrator, Premiere Pro and Dreamweaver among others.
LinkedIn Premium. 12 month subscription Winners — Candice Ota, Chip Reuben
GoProof from Oppolis Software. 3 month subscription for 2 users. Value $300.00 Winner — Alejandro Rubalcava
Proofing add-on for Adobe Creative Cloud. Version history tracks what has been changed and by whom.
Markzware. Any single product. 12 month subscription. Value $199.00 Winner — Susan Reuben (MT)
Choose one from the list below:
Q2ID (Quark to InDesign), Convert and open QuarkXPress files in InDesign.
PDF2DTP (PDF to InDesign), Convert PDF files to InDesign.
ID2Q (InDesign to Quark), Convert and open InDesign documents in QuarkXPress.
MT (Markzware), Convert InDesign documents to IDML files readable by InDesign CS4 through CC 2017.
FC (FlightCheck), Check native and PDF files for printing quality.
Expo Creative Asset Manager for Mac from Insider Software. Value $149.00 Winner — Wayne DeSelle
Digital asset manager that allows you to view, tag, search and manage images, icons, fonts, audio, video, app documents.
Suitcase Fusion 8 from Extensis. 12 month subscription. Value $119.95 Winner — Alan Gilbertson
Font management program that allows you to organize your fonts from one plane—including system fonts, purchased fonts, fonts synced from Adobe Typekit, Google fonts, etc.
Font Agent Pro 8 from Insider Software. Value $99.95 Winner — Susan Reuben
Windows font management that allows you to organize, distribute and control your fonts.
DTP Tools Cloud for InDesign. 6 month subscription. Value $77.40 Winner — William Baughman
Suite of 14 different InDesign productivity tools.
Multi-Find/Change 3.0 from Automatication. Value $49.95 Winner — Michael Powe
Extension for InDesign and InCopy that allows you to manage and execute Find/Change queries in batches rather than one at a time.
Adobe Stock. 15 image licenses. Value $44.00 Winner — Wayne DeSelle
Royalty-free, high-quality photos, videos, and illustrations.
InDesign Magazine. 6 month subscription. Value $30.00 Winner — Dallas Mathers
Monthly PDF publication devoted to InDesign how-tos, in-depth features, and quick tips.
LA Web Professionals Group meeting tickets.Value $7.99 (four raffles) Winners — Deena Bowman, Rocie Carrillo, Chip Reuben, Susan Reuben
Adobe user group that meets monthly with an emphasis on web design, marketing and the latest internet trends.
About the Presenter

Chad Chelius
Chad Chelius is a trainer, author, consultant, and speaker residing in the Philadelphia area. He’s been using Adobe products for over 25 years and began his career in the design and publishing industry. As an Adobe Certified Instructor and a consultant, he teaches and advises on all Adobe print and web products, specializing in InDesign and InCopy workflows, Illustrator, and PDF accessibility using Adobe Acrobat. He works with clients both large and small, in and outside the United States, helping them to solve problems, work smarter, and more efficiently using Adobe products.
Chad has been authoring content on Adobe products and related technologies for more than 15 years. He’s worked with leading publishers such as Peachpit Press/Adobe Press, Pearson Education, lynda.com and LinkedIn Learning He also contributes to InDesign Magazine, InDesignSecrets.com, and CreativePro.com. His latest book Learn Adobe Illustrator CC for Graphic Design and Illustration was just released.
As a speaker, Chad gives talks on Adobe applications at industry conferences of all sizes, including Adobe MAX, CreativePro Conference, The InDesign Conference, PePcon, and MakingDesign. When he’s not consulting and traveling, you’ll find Chad hanging out with his family or riding his road bike in the hills of beautiful Pennsylvania or snowboarding with his son and daughter. You can follow him on Twitter @chadchelius.