Find

Contents  Previous  Next

 

Menu: Search > Find

 

Default Shortcut Key: Ctrl+F

 

Macro function: Find()

 

The Find command is used to specify and initiate a search for a text string.  Many different options are available to make searching more flexible and more powerful. Wildcard characters (also known as Regular Expressions) can also be used within the search string.

 

If the search string is found the text cursor will be moved to the matching string and the text will be selected, if the Select matched text option is active.  The matched text can then be operated upon as can any other selected text.

 

If the search string is not found a dialog box will appear to report this fact.  If you prefer that this report appear on the message line instead, use the option provided on the Configure | Preferences | Messages options page.  The option is titled Report failed searches in a popup message box.

 

The controls and options in the Find dialog box are described below:

 

SearchFind

 

Find

This is the edit box where the search string is entered.  When the Find command is issued, the word beneath the text cursor is placed into the Find edit box, in case that word--or a word which is nearly the same--is to be the search string.  The Find Fast command can also be used to search for the word at the text cursor without raising the Find Text dialog.  To recall a search string which was previously entered, use the drop-down list or press the up or down arrow keys to review the items in the history list.  Regular Expressions may be used within the search string.

 

bm1The Delete key can be used while the drop-down list is displayed to delete a selected entry from the history list.

 

bm1Special characters can be entered into the Find edit box using the technique described in the Help topic Inserting Special Characters.

 

Insert Tab

Use this button to insert a tab character into the Find edit box.

 

Ordinarily, the Tab key is used to move from field to field within a dialog box.  If you would prefer that the Tab key insert a tab character in this dialog box, and in other Find/Replace related dialog boxes, check the relevant box on the Configure | Preferences | Tabs dialog page.

 

bm2In most fonts, the tab character does not have a unique visual representation.  It will often be depicted as an open square box (), as will be other characters in the low-ASCII portion of the character set.

 

Sort list

If this box is checked the history list will be maintained in alphabetic order, rather than in the order the strings were entered.

 

bm2When switching to an alphabetically sorted list, the chronological ordering of the list will be lost, and cannot be restored by unchecking the checkbox.

 

bm2No attempt is made to associate the history list entries with the time that they were added to the list.  If a sorted history list is used consistently, over time the list will come to hold an unrepresentative set of search phrases.  In the extreme case, after many Find operations, a list could result that contained only phrases beginning with the letter 'A'.  This occurs because entries at the bottom of the list will be removed after the maximum size of the list is reached.

 

Direction

Forward

This option causes the search to be performed downward, toward the end of file.

 

Backward

This option causes the search to be performed upward, toward the start of file.

 

Search Options

Perl regular expressions

If this box is checked, wildcard characters within the search string will be interpreted according to the Perl-Compatible Regular Expression (PCRE) convention.  In part, this means that the asterisk (*) will cause a match of zero or more occurrences of the preceding character.  The period (.) will match any single character. For more information, see Regular Expressions.

 

Maximal matching

When using pattern matching characters, there can sometimes be more than one text string that matches the search string. This option can be used to request that the longest possible matching string be returned.

 

Match case

This option can be used to force the search string to be matched exactly. When unchecked, a case insensitive search is performed.

 

Match whole words

This option can be used to restrict matches to those strings which appear as a whole word.  The characters which serve to delimit words are user-configurable; see Configure | Preferences | Cursor Travel.

 

bm2The Match Whole Words option is logically incompatible with the Incremental Search option, and will therefore be disabled when Incremental Search is active.

 

Match at start of Line

This option can be used to force the search string to be matched only when a matching string appears at the start of a line.  This effect can also be achieved with a Regular Expression.

 

Match at end of Line

This option can be used to force the search string to be matched only when a matching string appears at the end of a line.  This effect can also be achieved with a Regular Expression.

 

Match syntax element

This option can be used to force a matching string to belong to a specified syntax group.  Example: you could type the search string 'while' and require that it be matched only when it appears as a Reserved Word.  Instances that occur within program comments or quoted strings (or any other syntax) would not be matched.  (This is a powerful capability with lots of potential, and one we've never seen in another editor.)

 

Scope

Selected Text

This option can be used to restrict the search to the extent of the selected text.

 

Cursor to bottom / Cursor to top

This option causes the search to be performed from the cursor onward, according to the current direction.  The search ends when either the top or bottom of the file is reached.

 

Wrap around

This option causes the search to be performed from the cursor onward, according to the current direction.  When either the top or bottom of file is reached, the search wraps around, and continues to the original cursor position.

 

bm2When Find Next or Find Previous are used in wrap around mode, a message appears on the status bar when the search has wrapped back to the location of the first match.  An option on the Configure | Preferences | Messages dialog page can be used if you prefer that this event be reported in a pop-up message box instead.

 

Top to bottom / Bottom to top

This option causes the search to be performed from the top or bottom of file onward, according to the current direction.

 

All open files

This option causes the search to be performed across all open files.

 

Active project

Use this option to limit the scope of the Find operation to those files within the active project.

 

Display Options

Incremental search

This option causes the search process to begin as soon as a character is pressed, rather than waiting for OK to be pressed.  When typing long search strings, you may find that the match is found before you're done, thereby saving typing.  Just press Enter to dismiss the dialog and remain at the displayed match.

 

bm2This option is disabled when Perl Regular Expressions are in use, since it is often the case that a regular expression cannot be properly evaluated until it has been completely typed.

 

Select matched text

This option causes the matched string to be selected so that it can be operated upon by any command that operates upon selected text.  When this option is not used, the text cursor is simply placed at the start of the matching string.

 

bm2This option is incompatible with the Extend Selection option, and will therefore be disabled when that checkbox is checked.

 

Highlight all matches

This option causes all instances of the matched string to be highlighted within the current file, and within other edited files.  The highlighting will persist until a new Find operation is performed, or until the end of the editing session.  Alternatively, highlighting can be disabled altogether using the View | Text Highlighting command (this also affects the general Text Highlighting feature). The foreground and background colors used to highlight matches can be set on the Configure | Colors dialog.

 

bm2This option is not available for searches which use Regular Expressions.

 

bm1To permanently configure one or more text strings for highlighting, use the Text Highlighting feature.

 

Extend Selection

This option can be used to extend an existing selection to the point of the matched string.

 

bm2This option is logically incompatible with the Select matched text option, and will therefore be disabled when that checkbox is checked.  This option will also be disabled when the Scope has been set to Selected text.

 

Show at

This option controls the screen position at which matched strings are displayed.  When a new match is already on-screen, it will be shown in place, without redrawing the screen. If the screen must be redrawn to show a new match, then the matching line will be positioned at the designated screen location.

 

Notes

 

bm1When the Incremental search and Select matched text options are both in use, the Find Next and Find Previous commands can be issued from the keyboard (F3 and Shift+F3, respectively) in order to display additional matches to the partially typed search string while the Find dialog is still open.