GroupDocsGists
10/19/2017 - 11:12 AM

WatermarkOperations-SearchWatermarkWithRegularExpression.cs

// For complete examples and data files, please go to https://github.com/groupdocs-watermark/GroupDocs.Watermark-for-.NET
using (Document doc = Document.Load(Utilities.MapSourceFilePath (DocFilePath)))
{
    Regex regex = new Regex(@"^© \d{4}$");

    // Search by regular expression
    TextSearchCriteria textSearchCriteria = new TextSearchCriteria(regex);

    // Find possible watermarks using regular expression
    PossibleWatermarkCollection possibleWatermarks = doc.FindWatermarks(textSearchCriteria);

}