Wildcards (or Character Classes)

Wildcards are one of the main features of GREP. The most important ones are listed in the next-to-last panel in the Find What flyout at Wildcards, though there are additional ones below at Modifiers and Posix.

A whole class of wildcards that can’t be picked in the interface at all are the so-called Unicode properties (they were introduced in CS4). We’ll illustrate the main ones along with other wildcards; see “Character Classes 3: Unicode Properties” on page 68 for a full overview. Finally, you can create your own wildcards by defining character classes, and this, too, will be illustrated below.

Any Character

As its name says, this wildcard matches anything. Its symbol is . (a dot). Enter a dot in the Find What field; clicking Find repeatedly finds each successive character in the document. The only exception is the return character (or paragraph mark), though this can be changed (see the section entitled “Single-line and Multiline” on page 53). Example: b..d finds all instances of four letters starting with a b and ending with a d. (Bug: the dot does not match footnote markers; see the troubleshooting section on page 64 for a workaround.)

Any Uppercase Letter

\u finds any uppercase letter. This covers all Unicode characters that can be considered letters, such as all Latin letters with accents, Cyrillic, Hebrew, and Arabic letters. I’ll reintroduce our “one or more” operator, +, from page 7, as it gives more sense to the wildcards outlined in this ...

Get GREP in InDesign now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.