SearchTextRegex(String,Int32,Boolean) Method
In This Topic
Searches for and highlights an occurrence of a given regular expression pattern within the current page of the document displayed in the GdViewer control according to the parameters you have specified. If the format of the displayed document is other than supported text-based formats, which currently are DOCX, TXT, RTF and PDF, this method will fail.
Be aware that this method uses InvariantCulture comparison when searching. It means, that characters are comparing using culture-sensitive sort rules and the invariant culture, in other words this method respects accents when searching.
Please note that currently defined highlighted regions are enriched with those recognized by this search. You can use the RemoveAllRegions method before starting new search to ensure the previously defined regions will remove.
Syntax
'Declaration
Public Overloads Function SearchTextRegex( _
ByVal As String, _
ByVal As Integer, _
ByVal As Boolean _
) As Boolean
public bool SearchTextRegex(
string ,
int ,
bool
)
public function SearchTextRegex(
: String;
: Integer;
: Boolean
): Boolean;
public function SearchTextRegex(
: String,
: int,
: boolean
) : boolean;
public: bool SearchTextRegex(
string* ,
int ,
bool
)
public:
bool SearchTextRegex(
String^ ,
int ,
bool
)
Parameters
- Pattern
- The regular expression pattern to search for.
- Occurence
- The occurrence of the searched expression on the current page. Set the occurrence to 0 if you are searching for all occurrences of a given text.
Set the occurrence to 1 if you are searching for the first occurrence, set it to 2 for the second etc.
- CaseSensitive
- Set this parameter to true if you want to apply case-sensitive search, otherwise set it to false.
Return Value
true if the given text expression has been found on the current page according to the specified parameters, otherwise false. The
GetStat method can be subsequently used to determine if this method has been successful.
See Also