←Select platform

RegexParameters Constructor(RegexParameters)

Summary

Initializes a new instance of RegexParameters. This is a copy constructor.

Syntax
C#
C++/CLI
Java
Python
public RegexParameters( 
   RegexParameters r 
); 
__init__(self,r) # Overloaded constructor 

Parameters

r

RegexParameters to copy from.

Remarks

Regex parameters cannot act on their own. When they are made, they need to be added to the RegexParameter list in the matching RegexInspectorElement.

Example

Adding a regex parameter to find one or more capital letters, a space, then one or more capital letters.

C#
Java
using Leadtools; 
using Leadtools.Document.Unstructured; 
using Leadtools.Document.Analytics; 
 
using Leadtools.Document.Unstructured.Highlevel; 
using Leadtools.Ocr; 
using Leadtools.Document; 
 
public void DocumentUnstructuredRegexParametersExample() 
{ 
      var r1 = new RegexInspectorElement() 
      { 
          Id = "r1", 
          IncludeWholeWord = true, 
          IncludeWholeLine = false 
      }; 
 
      r1.RegexParameters.Add(new RegexParameters() 
      { 
          Pattern = @"[A-Z]{1,}\s[A-Z]{1,}", 
          PatternIsOEM = false, 
          IgnoreSpaces = false, 
          IgnoreCase = false, 
          ApproximateRegexMode = ApproximateRegexMode.Disabled, 
          UseLettersToNumbersMapping = false, 
          AllowSubWordsMatching = true, 
          MinimumLength = 1, 
          MaximumCost = 0 
      }); 
} 
 
import java.io.File; 
import java.io.FileReader; 
import java.io.IOException; 
 
import java.util.List; 
import java.util.Scanner; 
 
import org.junit.*; 
import org.junit.runner.JUnitCore; 
import org.junit.runner.Result; 
import org.junit.runner.notification.Failure; 
 
import com.google.gson.JsonObject; 
import com.google.gson.JsonElement; 
import com.google.gson.JsonParser; 
 
import leadtools.*; 
import leadtools.document.DocumentFactory; 
import leadtools.document.DocumentTextExtractionMode; 
import leadtools.document.DocumentTextImagesRecognitionMode; 
import leadtools.document.LEADDocument; 
import leadtools.document.LoadDocumentOptions; 
import leadtools.document.analytics.ElementResult; 
import leadtools.document.analytics.ElementSetResult; 
import leadtools.document.analytics.internal.ApproximateRegexMode; 
import leadtools.document.unstructured.RegexInspectorElement; 
import leadtools.document.unstructured.RegexParameters; 
import leadtools.document.unstructured.highlevel.FeatureResourceBuilder; 
import leadtools.document.unstructured.highlevel.FeaturesProcessingEngine; 
import leadtools.document.unstructured.highlevel.IFeature; 
import leadtools.ocr.OcrEngine; 
 
 
public void documentUnstructuredRegexParametersExample() { 
   RegexInspectorElement r1 = new RegexInspectorElement(); 
   r1.setId("r1"); 
   r1.setIncludeWholeLine(false); 
   r1.setIncludeWholeWord(true); 
 
   RegexParameters r2 = new RegexParameters(); 
   r2.setPattern("[A-Z]{1,}\\s[A-Z]{1,}"); 
   r2.setPatternIsOEM(false); 
   r2.setIgnoreSpaces(false); 
   r2.setIgnoreCase(false); 
   r2.setApproximateRegexMode(ApproximateRegexMode.DISABLED); 
   r2.setUseLettersToNumbersMapping(false); 
   r2.setAllowSubWordsMatching(true); 
   r2.setMinimumLength(1); 
   r2.setMaximumCost(0); 
   r1.getRegexParameters().add(r2); 
} 
Requirements

Target Platforms

Help Version 23.0.2024.2.29
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2024 LEAD Technologies, Inc. All Rights Reserved.

Leadtools.Document.Unstructured Assembly
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2023 LEAD Technologies, Inc. All Rights Reserved.