The Find / Replace dialog is opened from menu
or the toolbar button
Find / Replace. It
enables you to define search and replace operations on the current document. The find works on
multiple lines, which means a find match can cover characters on more than one line. Special
characters like newline and tab can be inserted using the contextual menu.
To insert a new line in the find or replace text area, press
(CTRL + Enter) instead of
(Enter). The replace operation can bind Perl 5 regular
expression group variables ($1, $2, etc.) from the find match. For example to replace the tag
with attributes 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 following actions can be executed in the Find / Replace
dialog:
- Find occurrences of a word or string of characters including white spaces, represented on
one or multiple lines. Highlight their position in the editor.
- Replace occurrences of target defined in the Text to find area with
a word or string of characters, including white spaces, that can be on a line or on multiple
lines, defined in the Replace with area.
- Find all occurrences of a word or string of characters
including white spaces that can be on a line or on multiple lines and display a result list
to the message panel.
- Replace all occurrences of a word or string of characters including white spaces that can
be on a line or on multiple lines.
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 check the
Regular expression checkbox. 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. Special characters
like newline and tab can be inserted using the contextual menu. It may contain Perl 5
regular expression group markers, only if the search expression is a regular expression and
the Regular expression checkbox is checked.
Note: Some regular expressions may block indefinitely the Java Regular Expressions engine. If the execution of the regular expression does not end in about five seconds, the application displays a dialog that allows you to interrupt the operation.
Unicode characters can also be used in the
Replace with area.
- The history buttons
-
The last find and replace operations history is available using the
history buttons from the top of the
find and replace text areas.
- XPath - The XPath 2.0 expression
you input in this combo is used to restrict the search scope.
The
content
completion assistant
helps you input XPath expressions,
valid in the current context.
- Direction - Specifies if the search direction is from current
position to end of file (Forward direction) or to start of file
(Backward direction).
- Scope - Specifies if the search is executed on all file or only on
the lines that were selected when the dialog was invoked. If the selection was on a single
line the search is executed on the whole file (by default the All
option is selected).
- 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.
- Find All - Executes a find operation and
displays all results to the message panel.
- 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, operations are
case-sensitive.
- Whole words only - When checked, only whole
occurrences of a word will be included in the operation.
- Incremental - When checked, the search operation is started every
time you type or delete a letter in the Text to find text box.
- Regular expression - When checked, it allows you to use
regular expressions in Perl 5 syntax. A content completion assistant window is available to
help you edit regular expressions. It is activated every time you type \(backslash
key) or on-demand if you press Ctrl-Space.
- Dot matches all - A dot used in a regular expression matches also
end of line characters.
- Wrap around - Continues the find from the start (end) of the
document after reaching the end (start) when the search is in forward (backward)
direction.
- Enable XML search
options - When checked, the dialog is enlarged and the XML search options are
shown below. This option restricts the search domain to the checked XML component
types.
The supported XML component types are the following:
- Element names - Only the names are searched, without '<',
'/', '>', attributes or white-spaces. e. g.: <element />.
- Element contents - Search in the text content of XML
elements.
- Attribute names - Only the attribute names are searched,
without the leading or trailing white-spaces.
- Attribute values - Only the attribute values are searched,
without single quotes(') or double quotes("). e. g.: 'value' or
"value"
- Comments - Only the content of comments are searched, skipping
'<!--', '-->'. e. g.: <!--Comment content-->
- Processing Instructions (PIs) - Only the content are searched,
skipping '<?', '?>'. e. g.: <?processing instruction?>
- CDATA - Only the content are searched, skipping '<![CDATA[',
']]>'. e. g.: <![CDATA[cdata content]]>
- DOCTYPE - Only the content of the DOCTYPE section are
searched.
- Entities - Only the entity names are searched.
The two buttons Select All and Deselect
All allow a simple activation and deactivation of all types of XML
components.
Note: Please note that since searching in some XML component types is
performed only on their content skipping some of their headers / footers (see the list
above), even if all the XML component types are checked, some filtering is still
performed. To completely disable it you have to uncheck the option Enable XML
search options.
- Find All Elements / Attributes ... - In
Author mode an attribute cannot be searched directly. For finding an attribute just click on
the link Find All Elements / Attributes ... in the dialog which opens
the dialog with the same name.