IEditorOperations::ReplaceAllMatches Method (String^, String^, Boolean, Boolean, Boolean)
Visual Studio 2015
Replaces all matching occurrences of the given string.
Assembly: Microsoft.VisualStudio.Text.UI (in Microsoft.VisualStudio.Text.UI.dll)
int ReplaceAllMatches( String^ searchText, String^ replaceText, bool matchCase, bool matchWholeWord, bool useRegularExpressions )
Parameters
- searchText
-
Type:
System::String^
The text to match.
- replaceText
-
Type:
System::String^
The replacement text.
- matchCase
-
Type:
System::Boolean
true if the search should match case, otherwise false.
- matchWholeWord
-
Type:
System::Boolean
true if the search should match whole words, otherwise false.
- useRegularExpressions
-
Type:
System::Boolean
true if the search should use regular expressions, otherwise false.
| Exception | Condition |
|---|---|
| ArgumentNullException | searchText is null. |
| ArgumentException | useRegularExpressions is true and searchText is an invalid regular expression. |
If any of the matches found is read-only, none of the matches will be replaced.
Show: