To open the Find / Replace dialog, either go to or click the toolbar
button. You can also press Ctrl+F
(Meta+F) keys on your keyboard to display the
Find/Replace dialog.
Find / Replace Dialog
You can use the Find/Replace dialog to perform the following
operations:
- Replace occurrences of target defined in the Text to find area with
a new fragment of text defined in Replace with area.
- Find all the occurrences of a word or string of characters (that can span over multiple
lines) in the document you are editing. This operation also takes into account all the white
spaces contained in the fragment you are searching for.
The
find operation works on multiple lines, meaning that a find match can cover
characters on more than one line of text. To input multiple-line text in the
Text
to find and
Replace with areas, do one of the following:
- press
Ctrl+Enter keys on your keyboard;
- use the Insert newline contextual menu action.
You can use Perl 5 regular expressions to define patterns. A content completion
assistant window is available in the Text to find and
Replace with areas to help you edit regular expressions. It is
activated every time you type \(backslash key) or on demand if you press
Ctrl+Space keys on your keyboard.
The replace operation can bind Perl 5 regular expression group variables ($1,
$2, and so on.) from the find match.
To replace an XML tag called tag-name with the tag
tag-name1, use <tag-name(\s+)(.*)> in the Text to
find area and <tag-name1$1$2> in the Replace
with area.
The dialog contains the following options:
- Text to find - The target character string to
search for. You can search for Unicode characters specified in the \uNNNN
format. Also, hexadecimal notation (\xNNNN) and octal notation
(\0NNNN) can be used. In this case you have to select the
Regular expression option. For example, to search for a space
character you can use the \u0020 code.
- Replace with - The character string with which to replace the
target. The string for replace can be on a line or on multiple lines. It can contain Perl 5
regular expression group markers, only if the search expression is a regular expression and
the Regular expression option is selected.
Note: Some regular expressions can block indefinitely the
application. If the execution of the regular expression does not end in about 5
seconds, the application displays a dialog that allows you to interrupt the
operation.
Note: Special characters like newline and
tab can be inserted in the Text to find and
Replace with text boxes using dedicated actions in the
contextual menu (Insert newline and Insert
tab).
Unicode characters can also be used in the
Replace
with area.
- The history buttons -
Contain lists of the last find and replace expressions.
- Direction - Specifies if the search direction is from current
position to end of file (Forward) or to start of file
(Backward).
- Scope -
- Find - Executes a find operation for the next occurrence of the
target. It stops after highlighting the find match in the editor panel.
- Replace - Executes a replace operation for the target followed by a
find operation for the next occurrence.
- Replace All - Executes a replace operation in the entire scope of
the document.
- Replace to End - Executes a replace operation starting from current
target until the end of the document, in the direction specified by the current selection of
the Direction switch (Forward or
Backward).
- Case sensitive - When checked, the search
operation follows the exact letter case of the Text to find.
- Whole words only - Only entire occurrences of a
word are included in the search operation.
- Incremental - The search operation is started every time you type
or delete a letter in the Text to find text box.
- Regular expression - When this option is enabled, you
can use regular expressions in Perl 5 syntax to look for specific pieces of text. A match
can span over multiple lines of text.
- Dot matches all - A dot used in a regular expression matches also
end of line characters.
- Wrap around - When the end of the document is reached, the search
operation is continued from the start of the document, until its entire content is
covered.