search direction s-text r-text action respect-case| Keys | Menu | |
| X | Control+S or Control+R or F5 | Edit/Search... |
Let direction be either forward or backward, s-text and r-text be strings, and action be search, replace, or replace-all.
respect-case is a switch, which if on means that search will find only those strings that match the search string exactly. If off, then both upper and lower case are matched.
Search(direction, s-text) searches for the next (previous) occurrence of the string s-text in the object in the given direction starting from the position of the insertion cursor. The occurrence, if found, is highlighted as the textual selection and the structural selection is set to the smallest phrase enclosing the textual selection. If no occurrence of s-text is found before the end (beginning) of the buffer, print an error message; if the command is repeated thereafter, wrap aroundi.e., continue the search at the beginning (end) of the buffer.
Replace(direction, s-text, r-text) replaces the current textual selection with r-text, creating a text buffer, if necessary, in the same manner as cut-text would. The replacement is followed by a search for the next occurrence of s-text in the given direction. If parsing is enabled and the next occurrence of s-text is outside the text buffer, it will be parsed when the textual selection is moved away. If no occurrence of s-text is found before the end (beginning) of the buffer, print an error message; if the command is repeated thereafter, wrap aroundi.e., continue the search at the beginning (end) of the buffer.
Replace-all(direction, s-text, r-text) iterate replace (as described above) until the end (beginning) of the buffer is reached.