Back to Devexpress

SearchOptions Enum

officefileapi-devexpress-dot-xtrarichedit-dot-api-dot-native-9db0c97d.md

latest2.6 KB
Original Source

SearchOptions Enum

Lists options used for searching.

Namespace : DevExpress.XtraRichEdit.API.Native

Assembly : DevExpress.RichEdit.v25.2.Core.dll

NuGet Package : DevExpress.RichEdit.Core

Declaration

csharp
[ComVisible(true)]
[Flags]
public enum SearchOptions
vb
<ComVisible(True)>
<Flags>
Public Enum SearchOptions

Members

NameDescription
None

Performs a search regardless of the case of the characters. Finds the occurrence of a string in a text. Strings will match even if the case is different (e.g. “mystring” will match “myString”).

| | CaseSensitive |

Performs a case sensitive search. Only exact matches are found (e.g. “myString” matches “myString” but not “mystring”).

| | WholeWord |

Search strings will only match if neither an alphabetical character nor a decimal digit occurs on either side of the string.

|

Remarks

The SearchOptions are specified for the SubDocument.FindAll and SubDocument.ReplaceAll methods. They are used when obtaining the ISearchResult interface via the SubDocument.StartSearch method.

The SearchOptions is a flags enumeration. Combine enumeration members with the unary OR operator to compose a complex option. For example, to perform a case-sensitive search for a whole word, use the (SearchOptions.CaseSensitive | SearchOptions.WholeWord) expression.

The following code snippet searches a placeholder for the “FirstName” field in a Word document:

View Example

cs
// Find a placeholder for the FirstName field:
DocumentRange[] nameRanges =
    document.FindAll("FirstName", SearchOptions.WholeWord);
vb
' Find a placeholder for the FirstName field:
Dim nameRanges() As DocumentRange = document.FindAll("FirstName", SearchOptions.WholeWord)

See Also

DevExpress.XtraRichEdit.API.Native Namespace