ClassDocumentTextSearch
Provides functionality for searching text in a RadDocument.
Definition
Namespace:Telerik.Windows.Documents.TextSearch
Assembly:Telerik.Windows.Controls.RichTextBox.dll
Syntax:
public class DocumentTextSearch
Inheritance: objectDocumentTextSearch
Constructors
DocumentTextSearch(RadDocument)
Initializes a new instance of the DocumentTextSearch class.
Declaration
public DocumentTextSearch(RadDocument document)
Parameters
document
The document to search in.
DocumentTextSearch(RadDocument, RegexOptions)
Initializes a new instance of the DocumentTextSearch class.
Declaration
public DocumentTextSearch(RadDocument document, RegexOptions options)
Parameters
document
The document to search in.
options
The options which will be used in the search.
Methods
Find(string)
Finds the string that matches a specified regular expression.
Find(string, DocumentPosition)
Finds all strings after a specific position in the document that match a specified regular expression.
Declaration
public TextRange Find(string regex, DocumentPosition fromPosition)
Parameters
regex
The regular expression.
fromPosition
Start position.
Returns
The first match.
Find(string, DocumentPosition, DocumentPosition)
Finds a string between specific positions in the document that matches a specified regular expression.
Declaration
public TextRange Find(string regex, DocumentPosition fromPosition, DocumentPosition toPosition)
Parameters
regex
The regular expression.
fromPosition
Start position.
toPosition
End position.
Returns
The first match.
FindAll(string)
Finds all strings in the document that match a specified regular expression.
Declaration
public IEnumerable<TextRange> FindAll(string regex)
Parameters
regex
The regular expression.
Returns
A collection of TextRanges representing the matches.
FindAll(string, DocumentPosition, DocumentPosition)
Finds all strings between specific positions in the document that match a specified regular expression.
Declaration
public IEnumerable<TextRange> FindAll(string regex, DocumentPosition fromPosition, DocumentPosition toPosition)
Parameters
regex
The regular expression.
fromPosition
Start position.
toPosition
End position.
Returns
A collection of TextRanges representing the matches.