This extremely powerful command can be used to locate all occurrences of one pattern and replace them to 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 (depends on the file's size and resulting number of noncontiguous matches).

Replace All Results

After all occurrences of the search pattern are found and replaced, the message box with a total number of occurrences is displayed. If there were no matches, the message box with "No matches" text is displayed.

The Replace All command is always faster than a series of commands, such as Find All and Fill, or Find All and Delete. The latter command sequence is easily replaced with a Replace All command with empty replace pattern.

Replace All command, as most other commands, creates an operation in the operation history.

Regular Expressions

The Replace All 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.

Take the following limitations into account:

See Also