ITextSearchService2::Find Method (SnapshotSpan, SnapshotPoint, String^, FindOptions)

 

Searches for the next occurrence of the given search pattern, using the given search range, starting position and options.

Namespace:   Microsoft.VisualStudio.Text.Operations
Assembly:  Microsoft.VisualStudio.Text.Logic (in Microsoft.VisualStudio.Text.Logic.dll)

Nullable<SnapshotSpan> Find(
	SnapshotSpan searchRange,
	SnapshotPoint startingPosition,
	String^ searchPattern,
	FindOptions options
)

Parameters

searchRange
Type: Microsoft.VisualStudio.Text::SnapshotSpan

[in] The range of text to search in.

startingPosition
Type: Microsoft.VisualStudio.Text::SnapshotPoint

[in] The position from which to begin the search.

searchPattern
Type: System::String^

[in] The text pattern to search for.

options
Type: Microsoft.VisualStudio.Text.Operations::FindOptions

[in] Options to use for the search.

Return Value

Type: System::Nullable<SnapshotSpan>

This method is safe to be executed on any thread.

Returns the text span containing the match if a match was found; otherwise, returns null if no matches were found.

ArgumentException if the UseRegularExpressions option is set and the search string is an invalid regular expression.

Return to top
Show: