Copy link to clipboard
Copied
I create engineering proposals and there are a lot of abbreviated terms that are used. I typically define the first occurence and then do a search for the phrase and/or abbreviation thereafter. In a short document, that usually works fine and is pretty efficient. Recently, I've started a larger proposal that has at least 50 abbreviations/acronyms (and there may be more after all authors have contributed) and was wondering how to write a GREP to find all of them in a document. Can any help me write a GREP or provide some guidance in this matter? Thanks in advance.
Grep for Acronyms:
(?<=\W)\u\u+(?=\W)
if you use this in a Paragraph style you can even apply a character style on your acronym with specific formatting.
Copy link to clipboard
Copied
To find them all and do what to them, exactly?
Copy link to clipboard
Copied
And why GREP rather than a plain text search?
Copy link to clipboard
Copied
Thanks everyone. I think I may have to go "old school" and just keep a list and do a search. Have a super day.
Copy link to clipboard
Copied
Do they all share some particular pattern characteristic, such as being a series of capital letters, that allows them to be found uding GREP?
Copy link to clipboard
Copied
Yes, all of them are alpha CAPS, and there were only 2 that had a numerals in them (IAP2 and P3), and no punctuation in any of them (e.g., periods, slashes, or hyphens)
Copy link to clipboard
Copied
Copy link to clipboard
Copied
Grep for Acronyms:
(?<=\W)\u\u+(?=\W)
if you use this in a Paragraph style you can even apply a character style on your acronym with specific formatting.
Copy link to clipboard
Copied
Thanks everyone for your input. My goal for finding all the acronymns in a large document was this. Find them, apply a character style to them. After the first instance of defining them, I wanted to use the hyperlink text anchor feature on the rest and put the definition in the text field box. (The character style would allow me to search the document to find all instances and apply the hyperlink text). That way, if something was defined on page 1 but wasn't used again until further in the document, the reader could hover over the acronym (in the exported PDF) and it would be defined. It was just something extra I wanted to add to my document for the ease of the reader and not have to figure out what a technical abbreviation stood for if it was buried in a sea of text on previous pages. I still plan to use that feature but may have to manually keep track of the acronymns/abbreviations used. The GREP provided in the previous post worked finding some but not all of them. GREPs are new to me and I need to do some more training to understand them more.
Copy link to clipboard
Copied
Seems to me this is genrally a good plan, but you might want to use a different character style for each acronym so you can isolate each one for setting the correct hyperlink. of necessity this means you would need to find each one separately, so a plain text search would work, using a list of tthe acronyms used.
There's a Find/Change by List script in the sample scripts installed with InDesign that can be modified to let you add them all and do it in one shot.
Copy link to clipboard
Copied
Thanks! I've heard of that List script command recently and need to test it out. That's a good suggestion about different character styles too but when I have a document that has 40-50 acronymns that's a lot of char styles to create and keep track of. On a smaller document, I may give that a try and test the waters.
Copy link to clipboard
Copied