

There’s no GREP required for this in CS3. In CS3, you can turn off the ligatures using this style with Find/Change, and it can be a Text-based Find/Change. The only thing that should be assigned to this character style is that Ligatures should be specifically shut off (as shown below). should be blank, all checkboxes left in the “neutral” state, and all pull-down menus set to Ignore (or completely blank). Make a character style that has everything else about it shut off or undefined (in other words, every field for Font, Style, Size, etc. Whichever version you’re using, the beginning of the process is the same. The First Step: Create a Ligature-Killing Character Style There’s a good way to do it in CS3 (with GREP Find/Change) and a better way to do it in CS4 (with a GREP Style). You can follow any responses to this entry through the RSS 2.0 feed.īoth comments and pings are currently closed. The screen shot below shows this in InDesign’s Find/Change dialog, along with what it finds on the page. In my opinion, as a GREP geek, this is a huge hidden functionality discovery that opens up even more possibilities for an already great InDesign feature.

To do that, all I needed to do was put $1 in the Change to field. In this instance, it doesn’t really matter which of the two I put back, since they’re both the same, so I opted to put back the first one. The first is (.+), which InDesign would consider Found Text 1 ( $1), and the second is the backreference (\1), which InDesign would consider Found Text 2 ( $2).

However, I’ve created two subexpressions. In the Change to field, I only want to put back one of these two instances. (\1) refers back to whatever text was matched by (.+) above. (.+) is a subexpression made up of any character one or more times So, in the Find what field, the search string appears this way: So…to extend this out to solve the duplicate line problem, I needed to define a line ( any string of text followed by a return) as a subexpression (by enclosing it in parentheses), then use a backreference to define a duplicate of that same line, using BBEdit’s “found text 1” metacharacter ( \1) instead of InDesign’s ( $1). Without it, this text cleanup task would be impossible. In BBEdit, the \1 metacharacter is the equivalent of InDesign’s $1 metacharacter for “Found Text 1,” and while that BBEdit convention would not be honored in the Change to field, I decided to give it a shot in the Find what field…and, sure enough, it works! This is completely undocumented GREP support that is very important. For instance, to look for the common duplicate word typo “the the,” you can search for (?‹=\1 )(the), which uses Positive Lookbehind to search for a subexpression consisting of the word “the,” but only if it is preceded by that same word and a space. However, those metacharacters don’t appear in the special characters for search menu at the end of the Find what field, nor do they work if you just type them in.īut I remembered that in BBEdit, you can do backreferences within a search. This “backreference” is, in InDesign, typically only done in the “change to” part of the search, using the “Found Text” metacharacters ( $0, $1, $2, and so on). Since using literal text is out of the question (each of the 10,000 listings is different), I needed a way to refer back to one part of the search criteria. What is it I’m looking for, exactly? In this case, I was looking for a line of text that is followed by another line made up of exactly the same text. When I do GREP searches, I try to frame in my mind the “idea” of the search as clearly as possible. However, once again, testing something out “just to see” if it would work paid off surprisingly well. If I were to go by the book, and didn’t know about GREP before it became part of InDesign, I probably would’ve thrown my hands up and said it couldn’t be done. The challenge was to use GREP to determine which were the problem listings, fix them, but leave the other listings as they were.Īnd this is how the problem listings showed up: In some, the first line of the listing was duplicated on the second line, but not all listings had this problem. In each listing, there was a company name and address. In this particular case, it was 10,000 companies, so doing it manually was not an option. The problem was this: removing duplicate lines in document of company listings. I was recently posed with a GREP challenge from a colleague that I thought would be relatively easy to solve in a dedicated GREP-savvy text editor like BBEdit, but it required something I wasn’t quite sure InDesign’s GREP Find/Change would handle.
