Barcode split with regex

Barcode split with regex

Postby » Wed Aug 01, 2012 2:11 am


I have a barcode that I have to split in half. I have the barcode splitted with some variables like the example below:


Here is where I am so far:

1. a. voj123456_
b. _12345
2. a. 132465423135456_
b. _12345
3. a. 1123_
b. _12345

I use a script with some regex builder like below:

Code: Select all
  KfxBorderou = RegexSearch(KfxBorderou, "\w{2,11}([_]+)")
      if KfxBorderou = "" Then
         KfxBorderou = "eroare la ocr"
       end if

  if KfxDocumentID = "" then
      KfxDocumentID = "nerecunoscut"
      KfxDocumentID = RegexSearch(KfxBorderou, "([_]+)\w{2,11}")
      if KfxDocumentID = "" Then
         KfxDocumentID = "eroare la ocr"
      end if
   End if

I must say that I don't know to trim the "_" space
Thank You
Posts: 9
Joined: Tue Mar 27, 2012 1:10 am

Re: Barcode split with regex

Postby » Mon Aug 06, 2012 1:01 am


If you are writing this in SBL then a simple loop can be used:

dim i as integer
dim tmpSTR as string
for i=1 to len(KfxBorderou)
if mid(KfxBorderou,i,1)<>"_" then tmpSTR=tmpSTR & mid(KfxBorderou,i,i)
next i

If you are writing in something more like VB, then it's even easier:


Hope that helps.
David Crewe

Check out our set of custom add-ons for Kofax Capture -
Posts: 232
Joined: Tue Apr 29, 2008 2:24 am
Location: UK

Return to Release Scripts General Discussion

Who is online

Users browsing this forum: No registered users and 1 guest