Find and Replace

The Find and Replace functions in the Script Editor allow you to find and replace strings in the Code View text editor. Clicking the Find  button or the Replace button on the Code View toolbar menu opens the Find/Replace dialog box, as shown in the figure below. Enter a string to search for in the Find What field.

 

The replace operation works in a similar way and replaces the Find What string(s) with the Replace With string(s).  All dialog options are the same, except that the Replace dialog box has a field called Replace With.

 

Find/Replace Dialog Box

Search Options

You can check one or more of the following search options:

Find and Replace Operations

When you are ready to execute a find or replace operation, click one of the following buttons:

Wildcard Characters

The Script Editor supports wildcards in the search string, but not the replace string. Wildcards support the Visual Basic "like" operator syntax.  This includes the familiar DOS wildcards "*" and "?", plus some others.  The like function is used to perform string comparison; it searches for a pattern inside a string and returns a value that indicates whether the pattern is contained in the string or not.  The “like” operator accepts three parameters:

You can use these special symbols in pattern matches to match a single character in the source string:

Note: To match the special characters left bracket ([), question mark (?), number sign (#), and asterisk (*), enclose them in brackets. The right bracket (]) cannot be used within a group to match itself, but it can be used outside a group as an individual character.

 

By using a hyphen (-) to separate the upper and lower bounds of the range, charlist can specify a range of characters. For example, [A-Z] results in a match if the corresponding character position in string contains any uppercase letters in the range A-Z. Multiple ranges are included within the brackets without delimiters.

 

Other important rules for pattern matching include the following: