This task will show you how to find text in the document using a string or a regular expression, as well as replace the text you find.
The different Find options are explained as follows:
The Find option will search for any occurrence of a specified string. From the menu, select Edit | Find | Find… (Command + F). For finding a normal string, uncheck the Regular expression checkbox:
The Find option with the Regular expression checkbox checked will search for any occurrence using regular expressions. To do this, select Edit | Find | Find...:
The Find Next option will search for the next occurrence. From the menu, select Edit | Find | Find Next (Command + G).
The Find Previous option will search for the previous occurrence. From the menu, select Edit | Find | Find Previous (Command + Shift + G).
The Use Selection for Find option will search for the selected text. From the menu, select Edit | Find | Use Selection for Find (Command + E).
The Replace text functionality is included in the Find dialog box (select Edit | Find | Find… or Command + F). You can use Replace, Replace All, or Replace & Find, which are described in more detail in the How it works… section.
The Find dialog box has some very helpful options. These are as follows:
Ignore case will perform a find irrespective of case.
Replace will replace the currently selected find occurrence.
Replace All will replace all find occurrences in the document.
Replace & Find is useful to test out your find occurrences before using Replace All and is also useful when you're not quite certain if you want to replace everything.
- The button will output the number of occurrences of the find string or regular expression. This is helpful to do before a full replacement. Also, you can gauge the extent of the upcoming changes and make edits to your find text, if needed.
There are some extended features of the find functionality that are useful if you do a lot of searching or if you need to find and/or replace multiple lines.
In case you want to repeat a past Find and Replace search, there's a history drop-down you can use by clicking on the downward-facing triangle next to the input boxes.