Leftovers
There remain a few things that are available in InDesign's GREP interface but that haven't been covered. In the Modifiers flyout are two sets of modifiers, Single-line On/Off and Multiline On/Off, both of which influence the behavior of the .
wildcard ("match everything") and the location markers ^
and $
at paragraph endings.
Single-line mode determines the behavior of .
, which matches nearly everything. When Single-line mode is off, which is GREP's default state, .*
matches everything from the cursor position to the end of the paragraph. Enable single-line mode (with (?s)
), and .*
ignores line endings, selecting everything from the insertion point to the end of the story. If there is no insertion point and you have a text frame selected, (?s).*
selects the whole story—not just the text in the selected text frame—including any overset text.
The multiline settings influence the behavior of ^
and $
. When enabled, which is GREP's default state, ^
and $
match the beginning and the end of each paragraph, respectively: they respect paragraph boundaries. Disable multiline mode with (?-m)
), and ^
and $
ignore the paragraph boundaries, in effect becoming beginning-of-story and end-of-story markers—synonymous with \A
and \z
.
Get GREP in InDesign CS3 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.