Need training at your office? Request a quote for custom training.

Home / Adobe FrameMaker / Adobe FrameMaker: GREP to Replace Hyphens with En Dashes

Adobe FrameMaker: GREP to Replace Hyphens with En Dashes

by Barb Binder, Adobe Certified Instructor on FrameMaker
Updated: Nov 16, 2016

FrameMaker 12  supports GREP Find/Change, but I tend to forget about it because it’s not prominently featured in the Find/Change dialog box.

One of my major headaches in a FrameMaker layout job is updating hyphens to en dashes between ranges of numbers, as outlined in this post on GREP in InDesign: Adobe InDesign: GREP to Replace Hyphens with En Dashes. Without the aid of GREP, I run 10 replacements, 1- to 1–. 2- to 2–, etc. It’s tedious, but if I wait until I have all the files in the book, I can do it once and be done with it.

Until today. Thanks to a series of misfortunate events which made me sit back and think, “Isn’t there a better way?”, the lightbulb finally illuminated. A little voice piped up and said, “Barb! Copy the string from the InDesign blog post and paste it into FrameMaker!” And with one minor change*, it worked perfectly.

Here’s the setup in FrameMaker:

Adobe FrameMaker 12: GREP to Replace Hyphens with En Dashes

For your copy and pasting pleasure:
Find Text: (?x)\b(\d+)-(\d+)\b
Change to Text: $1–$2

Don’t forget to change from a Simple Search to Regular Expressions and, once you test the string, remember you can update the entire book. (Always test before you hit Change All!)

This simple GREP query will find all digits separated with a single hyphen and change those hyphens to en dashes. Now, if we could just get Adobe to add the widgets that make figuring this out easier, and the ability to save these strings for future reference!

* InDesign uses ~= to represent an en dash, so I replaced it with Alt + 0150 on the numeric keypad to add the en dash on the Change line.

If you’d like to receive notifications about future Rocky Mountain Training blog posts, our classes, or just want to stay in touch, please like our Facebook page.

Leave a Comment

Your email address will not be published. Required fields are marked *

One thought on “Adobe FrameMaker: GREP to Replace Hyphens with En Dashes