David Crewe Ltd


Independent Kofax KC³ Consultant

Regular Expression Extraction

Create an index zone large enough to cover the area where the required data can appear. Choose an appropriate base recognition profile.



Save the Recognition profile as a custom profile using Save As. In this case we are looking for a ZIP code so have called it floatingDataRecognitionZIP



Select Script and Create. Chose VB.NET as the Scripting Language.



At the top of the script add the line: Imports System.Text.RegularExpressions



Add a function called getRegExValue as shown below:



Using the drop downs, add code for RecognitionPostProcessing

Add code to call the getRegExvalue function you created before and pass the format of the data you are looking for, and the raw text from the larger zone.

In this case we are looking for 5 numerics – “[0-9]{5}”, but you could use any relevant regular expression format here. See here for some basic regular expression formats. A google search will provide more detailed examples if required



Save and Build the project. Close the editor and return to the Recognition Profile properties window. Hit Zone Test to see the results.



Recognition scripting guide


Validation scripting guide


Back to scripting overview