GREP Class Inserter
By clicking the @ icon on the GREP tab of the Find/Change window, you open a flyout menu which you can use to insert various GREP classes and other GREP...
This script is part of the GREP collection. See the full collection here.ย
Many of the GREP classes available in InDesign can be inserted using the GREP tab’s flyout menu. You open the menu by clicking the @ icon, highlighted in the following screenshot:
![[image: grep inserter interface]](http://www.creativepro.com/files/kahrel/indesign/images/GREP_classes-0.png)
The GREP-specific items are in the last six entries of the menu (Wildcards through to Posix). The problem with InDesign’s menu is that it’s not complete. It never has been: when GREP was introduced (in CS3), quite a few GREP classes that can be used in InDesign were not in the menu, and additions to InDesign’s GREP classes in CS4 and CS6 have never been added to the menu.
The script described on this page remedies all that. It creates a panel that contains all GREP wildcards, classes, and other features that can be used be used in InDesign. When you run the script, the following window is opened:
![[image: grep inserter interface]](http://www.creativepro.com/files/kahrel/indesign/images/GREP_classes-1.png)
On the left-hand side of the window you see the categories that the script knows. Click a triangle to expand a category and, if necessary, a subcategory. The following screenshot shows the window after we clicked Unicode properties, then Lowercase letter:
![[image: grep inserter interface]](http://www.creativepro.com/files/kahrel/indesign/images/GREP_classes-2.png)
The code appears in the field in the lower right of the window. This is a normal text field and you can copy the contents to the clipboard. Some items have a short explanatory text, which is shown in the larger pane, and as shown in the screenshots.
Some codes have a long and a short form. To show long forms, tick the Verbose checkbox. The result is shown in the field with the code: you see that \p{Li} is replaced with \p{Lowercase_letter} (not all items have long and short forms):
![[image: grep inserter interface]](http://www.creativepro.com/files/kahrel/indesign/images/GREP_classes-3.png)
To insert the code into the Find what field, click Insert item. But note that the script has no idea where the cursor is in the Find what field, so all it can do is append the code to the end of what is already in the field. If you want to insert a code somewhere in an existing GREP expression in the Find what field, copy the code in the GREP classes panel and paste it anywhere in the Find what field.
![[image: grep inserter interface]](http://www.creativepro.com/files/kahrel/indesign/images/GREP_classes-4.png)
Looking up GREP codes
To look up the meaning of an item in a GREP expression that you don’t know, enter the item in the script’s interface and click Look up. For example, if you come across the tag ~4 and you want to know what it stands for, type ~4 in the script’s text field and click Look up. The script then tells you that that tag stands for the quarter-space character:
![[image: grep code dictionary]](http://www.creativepro.com/files/kahrel/indesign/images/GREP_classes-5.png)
Looking up InDesign’s blue codes
When you show InDesign’s hidden characters (Type > Show Hidden Characters), you’ll see various special characters and codes, all shown in blue. To show the what these characters stand for and which code can be used in the Find What field to search these characters and codes, highlight the blue character and click Look up. In the screenshot, below, we highlighted the
character and clicked Look up. The panel shows that this is the non-breaking space character, and that you can search it using ~S.
![[image: grep code dictionary]](http://www.creativepro.com/files/kahrel/indesign/images/GREP_classes-6.png)
Peter Kahrel Script Repository
Hosted as a community service, and with deep appreciation, by CreativePro.com
Scripts by Topic | Script Index
Basic Script Installation and Use
How to Modify or Configure These Scripts
Resources for Scripting and Publishing Automation
About This Repository
Contact Peter Kahrel
Note to users: You run scripts at your own risk: CreativePro and the author accept no liability for anything that may be caused by any of these scripts. Always take the necessary precautions. We encourage you to save backups and test scripts on copies of your documents.
This article was last modified on August 22, 2026
This article was first published on November 3, 2025
Commenting is easier and faster when you're logged in!
Recommended for you
What is that Mysterious Space Character in InDesign?
Unicode lets you insert tens of thousands of different characters into your text...
Kerning Drop Caps
How to automate the kerning of tricky letter combinations in drop caps with InDe...
InDesign Basics: Working with Swatches
Swatches make using and modifying colors in InDesign easy and efficient. Learn h...
