3.1. Special Characters

Apart from their literal form, characters can also be given in hex format, either as a four-character Unicode string (\uHHHH) or as a two-character hex number (\xHH). The latter format can be used for characters with hex values smaller than FF. The letter "é", for instance, can be represented literally as 'é', in Unicode as \u00E9, and in hex as \xE9.

Some common special characters are \n (newline), \r (return, paragraph mark in InDesign), and \t (tab). The use of these characters is the same as elsewhere in JavaScript.

Get Automating InDesign with Regular Expressions now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.