The Replace command is used to locate a specific pattern in a file and replace it with another pattern. The Find & Replace Dialog is used to specify both patterns, as well as a number of additional options. It is not required that the size of the search and replace patterns equals, in addition, the replace pattern may be empty. In the latter case, found pattern occurrences are removed from the document.
Complexity: linear-time.
When you press the Replace button for the first time, Hex Editor starts searching for a pattern. When pattern is located, the cursor is moved to the beginning of the pattern and a Find & Replace Dialog is displayed again. Now you have a choice of pressing Find Next button to skip this match and search for another, or Replace button to replace this match and continue searching.
The direction of the next search is governed by the "Search up" or "Search down" option.
When there are no more matches, the message box is displayed.
The Replace command fully supports regular expressions. To search using regular expressions, select either "ASCII string (char[])" or "UNICODE string (wchar_t[])" pattern type, enter the regular expression, make sure the "Regular expression" checkbox is checked and enter the sub-expression number you want to search for. Sub-expression "0" represents the expression itself.
If the match is found, the cursor is moved to the beginning of the matched expression or sub-expression. When you use the Find Next command to find the next match, the search is started from the next cell, not the end of the matched expression. If you press the Replace button, the matched expression or sub-expression is replaced with a replace pattern.
Take the following limitations into account: