The regular expression pattern to search for.
The occurrence (rank) of the searched expression on the current page. Set the occurrence to 1 if you are searching for the first occurrence, set it to 2 for the second etc.

Rank equal to 0 is not accepted, it will always be converted to 1. Please note that the occurrence (rank) is always related to the current page.

Set this parameter to true if you want to apply case-sensitive search, otherwise set it to false.
Output parameter. If the searched expression has been found, this parameter will output an IEnumerable of rectangle areas that surround the occurrence in inches.





In This Topic
GdPicture14 Namespace / GdPicturePDF Class / SearchTextRegex Method

SearchTextRegex Method (GdPicturePDF)

In This Topic
Searches for an occurrence of a given regular expression pattern within the current page of the loaded PDF document according to the parameters you have specified. This method returns bounding box surrounding the searched expression or set of bounding boxes in case the searched expression spans across multiple lines, defined by its top left coordinates and by its width and height in inches, if the expression has been found.
Syntax
'Declaration
 
Public Function SearchTextRegex( _
   ByVal Pattern As String, _
   ByVal Occurrence As Integer, _
   ByVal CaseSensitive As Boolean, _
   ByRef BoundingBoxes As IEnumerable(Of RectangleF) _
) As Boolean
public bool SearchTextRegex( 
   string Pattern,
   int Occurrence,
   bool CaseSensitive,
   out IEnumerable<RectangleF> BoundingBoxes
)
public function SearchTextRegex( 
    Pattern: String;
    Occurrence: Integer;
    CaseSensitive: Boolean;
   Out  BoundingBoxes: IEnumerable
): Boolean; 
public function SearchTextRegex( 
   Pattern : String,
   Occurrence : int,
   CaseSensitive : boolean,
   BoundingBoxes : IEnumerable
) : boolean;
public: bool SearchTextRegex( 
   string* Pattern,
   int Occurrence,
   bool CaseSensitive,
   [PARAMFLAG::Out] IEnumerable<RectangleF>* BoundingBoxes
) 
public:
bool SearchTextRegex( 
   String^ Pattern,
   int Occurrence,
   bool CaseSensitive,
   [Out] IEnumerable<RectangleF>^ BoundingBoxes
) 

Parameters

Pattern
The regular expression pattern to search for.
Occurrence
The occurrence (rank) of the searched expression on the current page. Set the occurrence to 1 if you are searching for the first occurrence, set it to 2 for the second etc.

Rank equal to 0 is not accepted, it will always be converted to 1. Please note that the occurrence (rank) is always related to the current page.

CaseSensitive
Set this parameter to true if you want to apply case-sensitive search, otherwise set it to false.
BoundingBoxes
Output parameter. If the searched expression has been found, this parameter will output an IEnumerable of rectangle areas that surround the occurrence in inches.

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.
Remarks
This method is only allowed for use with non-encrypted documents.

It is recommend to use the GetStat method to identify the specific reason for the method's failure, if any.

See Also