In This Topic
GdPicture14.WPF Namespace / GdViewer Class / SearchTextRegex Method

SearchTextRegex Method (GdViewer)

In This Topic
Searches for an occurrence of a given text expression within the defined page of the document displayed in the GdViewer control according to the specified parameters and highlights the result or returns its coordinates.
Overload List
OverloadDescription
Searches for an occurrence of a given regular expression pattern within the defined page of the document displayed in the GdViewer control according to the parameters you have specified. This method returns the bounding boxes (rectangle) surrounding the searched expression on the required page defined by its top left coordinates and by its width and height in inches, if the expression has been found. This occurrence is not highlighted using this method.

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.

 
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.

 
See Also