New to Telerik UI for WinFormsStart a free 30-day trial

Provides functionality for searching text in a RadDocument.

Definition

Namespace:Telerik.WinForms.Documents.TextSearch

Assembly:Telerik.WinControls.RichTextEditor.dll

Syntax:

C#
public class DocumentTextSearch

Inheritance: objectDocumentTextSearch

Constructors

Initializes a new instance of the DocumentTextSearch class.

C#
public DocumentTextSearch(RadDocument document, RegexOptions options)
Parameters:documentRadDocument

The document to search in.

optionsRegexOptions

The options which will be used in the search.

Initializes a new instance of the DocumentTextSearch class.

C#
public DocumentTextSearch(RadDocument document)
Parameters:documentRadDocument

The document to search in.

Methods

Finds a string between specific positions in the document that matches a specified regular expression.

C#
public TextRange Find(string regex, DocumentPosition fromPosition, DocumentPosition toPosition)
Parameters:regexstring

The regular expression.

fromPositionDocumentPosition

Start position.

toPositionDocumentPosition

End position.

Returns:

TextRange

The first match.

Finds all strings after a specific position in the document that match a specified regular expression.

C#
public TextRange Find(string regex, DocumentPosition fromPosition)
Parameters:regexstring

The regular expression.

fromPositionDocumentPosition

Start position.

Returns:

TextRange

The first match.

Finds the string that matches a specified regular expression.

C#
public TextRange Find(string regex)
Parameters:regexstring

The regular expression.

Returns:

TextRange

The first match.

Finds all strings between specific positions in the document that match a specified regular expression.

C#
public IEnumerable<TextRange> FindAll(string regex, DocumentPosition fromPosition, DocumentPosition toPosition)
Parameters:regexstring

The regular expression.

fromPositionDocumentPosition

Start position.

toPositionDocumentPosition

End position.

Returns:

IEnumerable<TextRange>

A collection of TextRanges representing the matches.

Finds all strings in the document that match a specified regular expression.

C#
public IEnumerable<TextRange> FindAll(string regex)
Parameters:regexstring

The regular expression.

Returns:

IEnumerable<TextRange>

A collection of TextRanges representing the matches.