Using Find and Replace

You can search publication text for an extraordinary variety of items: not just words or parts of words, but a host of character and paragraph attributes such as fonts, styles, alignment, bullets and numbering, missing fonts, drop caps… even inline graphics and more! Once located, you can replace items either globally, or on a case-by-case basis.

To use Find and Replace on frame text:

  1. Choose Find & Replace… from the Edit menu.

  2. In the dialog, type the text to be found in the Find box and its replacement text (if any) in the Replace box. Click the down arrows to view recent items. Click either box’s button to use flyout menus to select formats or special characters, or define a regular expression (for a wildcard-type search).

  • Formats. If you specify only a format but no text in the Find box, each region of text using that format will be selected. If you specify some text to find as well, PagePlus will locate that text only where it also uses the format. If you specify a format but no text in the Replace box, the found characters will remain but the local formatting will be updated. If you specify text as well, the characters will also be replaced. Select Clear Format to remove any format specifications from the Find or Replace box, leaving other instructions intact.

  • Special characters are preceded by a ^ symbol, as shown on the submenu, e.g. ^c for a copyright symbol. If the character after ^ does not indicate one of these special characters, it is matched literally. Use ^^ if you actually wish to search for a ^ in the text. When searching for a special character, be sure to observe the case shown on the submenu. For example, ^r searches for a registered symbol, whereas ^R just searches for the letter R. Choose Other… to display the Insert Symbol dialog, which lets you select a specific character from any font set/subset, as Unicode characters or glyphs.

  • Regular expressions. A regular expression is a formula for generating a set of strings. You can define the expression using the flyout menu choices, and/or type directly into the Find box, using the special symbols listed on the submenus. See Constructing search expressions below for details and examples.

  • Marks, fields, and breaks. These searches locate only the special codes inserted in publication text, ignoring any actual text associated with the code. In other words, searching for an index entry highlights the index mark, not the index text. Field searches locate “active” information fields (those inserted with Update automatically checked), and ignore those with the option unchecked.

  1. Select the Range to be searched: Current Story (just the currently selected text object or story), or All Stories (all text), or Current Selection (only used with the Replace All function to operate on the currently selected text).

  2. Select Match whole word only to match character sequences that have white space (space, tab character, page break, etc.) or punctuation at each end, or which are at the start/end of a paragraph. Select Match case for case-sensitive search. Select Regular expressions to treat the contents of the Find box as an expression, rather than as a literal string to be found.

  3. Click Find Next to locate the first instance of the Find text.
    – or -
    Click Select All to highlight all instances of matching text in your document simultaneously.

  4. Click Replace if you want to substitute with replacement text. Alternatively, click Find Next again to skip to the next matching text. Continue using the Replace option as required until you reach the end of your document.
    – or -
    Click Replace All to replace all instances of the found text with the replacement text at the same time. PagePlus reports when the search is completed.

  5. Click Close to dismiss the Find and Replace dialog.

Constructing search expressions

The Find and Replace dialog lets you perform a wildcard-type search by using a regular expression—a formula for generating a set of strings—to specify complex search criteria. You can construct search expressions by selecting items from the Regular Expression menu adjacent to the Find box, and/or by typing directly into the Find box itself.

For example:

l[!a]nd

Will find “lend” but not “land” for subsequent replacement

^g

Will find inline graphics (pictures within text)

^p

Will find a punctuation mark

^$The

Will find the word “The” where it occurs at the start of a paragraph

 

The submenus in the Find and Replace dialog provide a complete listing of symbols you can use to construct regular expressions. Here are some additional pointers on usage and symbol order:

.

Matches any single character. For example:
 fl.w  finds flow, flaw and fl_w etc.

*

Matches 0 or more of the preceding character or specifier, i.e. “take it or leave it.” For example:
 ba*t  finds bt, bat, baat etc.
 t.*p  finds tp, tap, turnip, t232p etc.

+

Matches 1 or more of the preceding character or specifier. For example:
 ba+t  finds bat, baat etc. but not bt
 t.+p  finds tap, turnip, t232p etc. but not tp
  [since . stands for any single character]

[ ]

Matches characters within the given set. For example:
 [a-z]  any character in the range from a to z
 [aeiou]  any of the characters shown
 [aeiou]+  finds any sequence of vowels [i.e. builds the matched string to include any member of the specified set]
 [ad-fy]  characters a, d, e, f, y

[!]

The ! symbol, inserted after the opening bracket, inverts the expression: finds any [single] character except those specified. For example:
 [!a-z]  finds any character except a letter
 l[!a]nd finds lend but not land

^$, ^.

Matches at start and end of paragraph. For example:
 ^$The  finds the word The where it occurs at the start of a paragraph

^<, ^>

 

Matches at start and end of word. For example:
 ^<the  finds the words the and them etc. but not the word bathe

\

(Escape character) Excludes the following character from the regular expression, i.e. finds it literally. For example:
 \[  finds the open square bracket character

  • When searching for a regular expression, the shortest possible match is always made. For example, searching the text burn bright for the expression b.*r will first select bur from burn and then br from bright. It will not select burn br.

Using Find and Replace