Quick Reference

Character Representations


Two-digit hexadecimal code. \x{20} represents the space character


Four-digit hexadecimal code (Unicode): \x{0020} represents the space character

\N{unicode name}

Unicode names. \N{Latin small letter a with ogonek} represents ą. The Unicode’s name is case-insensitive, but it matches case-sensitively. Thus, both \N{latin small letter a with ogonek} and \N{Latin Small letter A with ogonek} match ą.

Character Classes 1: Standard Classes

I call these classes “standard” for lack of a better term. They were part of the first implementations of GREP, and of the three types of class, to this day the standard classes are the easiest to use.


A single character or a group of characters


Exclude single character or a group of characters


Any character except paragraph break


Word character: letters, digits, and underscore


Non-word character


Lowercase letter


Non-lowercase letter


Uppercase letter


Non-uppercase letter






Horizontal space: all spaces and tabs


Non-horizontal space characters


Whitespace character: all spaces, tabs, and returns


Non-whitespace character


Vertical space: break characters—paragraph break, forced line break, page, column, frame breaks.


Whatever is not \v

Character Classes 2: Posix Expressions

There is much overlap between the Posix class and the standard class. Most Posix expressions listed here can ...

Get GREP in InDesign now with the O’Reilly learning platform.

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