Lukas Engqvist
Media Teacher

Get a grip on GREP …and what it's for

Presentation Published 3/12/14 Last updated on 6/8/17

This is a presentation in InDesign that can be used to demonstrate how we can use powerful Find/Change functions in InDesign. It is linked to presentation given 12 March 2014.

Assumes basic knowledge of InDesign, Paragraph Styles, Character Styles and general ability to apply skills from one situation to another. It's hard but can save 100's of hours in real world production.

Many times we get junk text that needs to be cleaned. Human error is the biggest cause of reprints, so we want computers to do the tricky parts for us. It does matter that text has a good semantic structure, especially if we later want to use that text for other media. Having good semantic structure also frees us to be creative and try out options like choosing between indents or blank line.

For lesson plan I recommend using raw text files from any complex text will do (preferably text more than 200 pages).

Edit: Added a resource of a blank InDesign and IDML file with paragraph styles that contain Keep Options and GREP style on Body text that applies no-break to last space. These files are "as is" but may help in seeing new possibilities.

Age Levels
1+ Day

InDesign, Internet connection

CC License
Attribution Non-Commercial Share Alike
5 / 5 • 4 Ratings

Materials (2)

or Join for free to access materials

Comments (11)

Write a reply...
or Join for free to view all comments and participate in the discussion.

Anja Vlasblom

Posted on 4/22/16 8:42:45 AM Permalink

Thank you for this.

Susanne Tamir

Posted on 4/21/16 8:52:02 PM Permalink

The link was to the webinar was in the TtT course that is really hard for me ... You teach online or on a real school? I want to learn script too. I do just now a document for a friend in Indesign 25 pages with Video and Audio and i can use all i learned in the publishing course!

Lukas Engqvist

Posted on 4/22/16 6:10:49 AM Permalink

My day job is teaching in classroom. It is so much harder online, that course was some time back, and I've learned so much about how online works in the past 2 years… but still find it hard to limit the scope of a lesson.

Susanne Tamir

Posted on 4/21/16 7:51:54 PM Permalink

Just searched for something and found this ressource ! Thats so great as well the video is very helpful i read a lot about Grep and never really got to understand it so clear. Thanks a lot

Lukas Engqvist

Posted on 4/21/16 8:23:03 PM Permalink

Nice to see you found it. Have had a whole day supporting students with cleaning text today, I include it regularly in my second indesign course (along with using scripts)

Lukas Engqvist

Posted on 11/29/15 7:22:58 PM Permalink

Lukas Engqvist

Posted on 3/12/14 10:43:23 PM Permalink

Jeff Ratliff

Posted on 3/12/14 10:37:17 PM Permalink

Hi Lukas,

Thanks for the presentation today. Here was my question:

How can I use GREP to change a list like this:

lastname1, firstname1
lastname2, firstname2


firstname1 lastname1
firstname2 lastname2


Lukas Engqvist

Posted on 3/12/14 11:11:52 PM Permalink

You would need to know what is unique. If this is each at a paragraph start and you can limit the search to this text, then yes.

Assuming each name is on in a new paragraph and last name is followed by a comma.

In the Find What search for:


^ = At beginning of paragraph

(.+) = (any character one or more times) in your case the last name

(,\s) = (comma followed by any white space) followed by a comma and space

(.+) = (any character one or more times) the first name… is there a stop character?

note brackets mean that the text becomes found first, found second… etc.

In the Change to:

$3 $1

$3 = expression in third bracket the first name

space = space

$1 = expression in first bracket the last name

Jeff Ratliff

Posted on 3/13/14 12:53:53 AM Permalink

Wow. Thanks Lukas. I do this all the time when I get official lists of student names that need to be reversed for diplomas, certificates, the yearbook, etc.

I currently do this in Word, but not on the Mac I usually work on because Microsoft eliminated the macro capabilities around 2007 and I can't be bothered to learn Applescript or VisualBasic just for this one function. So, I'm a little embarrassed to say that whenever I need to perform this task, I seek out a Windows machine with an old version of Word.

Thanks again for your help.

Lukas Engqvist

Posted on 3/13/14 9:37:13 AM Permalink

Best way to learn is to apply the skills on something you do regularly. Please don't be shy to ask if there is any other project which you feel could need some GREP :)