Search dialog box

To open the search dialog box, do one of the following:


This dialog box searches and replaces text in your file. You can open a search dialog box for each file you are editing.

Enter the desired text or search string in the field next to the Find button. To search for control characters such as a tab, use the Quote command to enter them correctly. This command is invoked by pressing Ctrl+\. For example, if you want to search for a tab, press Ctrl+\ and then press Tab. You can copy and paste special characters from an Editor window.

To replace text, enter the desired text or replace string in the field next to the Replace button.

The Editor searches the current location in the file towards the end of the file for a forward search, and toward the top of the file for a backward search. If the search string is not found before it reaches the end or the beginning, it prints a message and stops. If you start again, it resumes the search from the beginning or the end of the file.

There are six buttons in the search window:

Find

Searches for and highlights the next occurrence of the search string. Simply pressing Enter also searches for the next occurrence.

Replace

Replaces the current selection with the replace string.

Replace Then Find

Replaces the current selection and then searches again.

Find Then Replace

Searches for the next occurrence of the search string, and replaces it with the replace string if found.

Replace All

Starts at the beginning of the file and replaces all occurrences of the search string with the replace string.

Undo

Undoes the last Editor command.

There are a number of check boxes, which click on and off, and several radio buttons, small circles that either contain a solid dot for "on," or are empty for "off." Radio buttons are in sets, and only one turns on at a time. The check boxes and radio buttons include:

Forward or Backward

Determines whether the search proceeds forward or backward.

Case: Exact or Either

Determines whether case should be matched. If Exact is on, then only strings that exactly match the case are found. For example, Fly matches Fly, but not fly or FLY. If Either is on, then case is ignored. For example, Fly matches both fly and FLY.

StartsWord or EndsWord

If only StartsWord is on, then the search string must appear at the beginning of a word. For example, fly matches fly or flybat, but not batfly.

If only EndsWord is on, then the search string must appear at the end of a word. For example, fly matches fly or batfly, but not flybat.

If they are both on, then the string must form a complete word. For example, fly matches fly, but not flybat or batfly.

If neither is on, then any occurrence of the string is found.

StartsLine or EndsLine

These are similar to StartsWord and EndsWord above, except they apply to the beginning and end of a line.

Normal

If this is on, then there are no special characters; that is, characters only match themselves.

WildCard

If this is on, then the following characters have a special meaning in the search string:

? Matches any single character except a newline.

* Matches any number of characters except newlines.

RegExpr

If this is on, then the following characters have a special meaning in the search string. In this description, a regular expression is an expression using any combination of the following special characters. Note that you cannot match a newline.
.
Matches any single character except a newline.
[string]
Matches any single character appearing in the string. For example, [abc] matches an a, b or c. You can specify character ranges by separating the start and end of the range with a -. For example, [b-e] matches any character between b and e (b, c, d, and e). To include a ] as part of the string, make it either the first character of the string, or the last character of a range. For example, []abc].

If the first character of the string is a ^, then it matches any character that does not match the rest of the string.
^
At the start of the search string, this matches the beginning of a line.
$
At the end of the search string, this matches the end of a line.
<
At the start of the search string, this requires the rest of the search string to match the beginning of a word. Same as the StartsWord toggle.
>
At the end of the search string, this requires the rest of the search string to match the end of a word. Same as the EndsWord toggle.
(re)
Matches the regular expression re enclosed in parentheses.
re*
Matches zero or more occurrences in succession of the regular expression re.
re1|re2
Matches regular expression re1 or regular expression re2.

For example:
a.d matches and, a d, and aud.
a.*d matches ad, are d, and abd.
<and matches and, but not stand.
are|is matches either are or is.
(are|is)* bad matches are bad, is bad, areisare bad, and bad.

The settings in this dialog box set the defaults for the next quick search.


Previous

Next



Copyright © 1999, Green Hills Software. All rights reserved.