You are viewing limited content. For full access, please sign in.

Question

Question

Quickfields not returning right values for Pattern Matching

asked on October 1, 2014

Hi,

 

I have a Quickfields session (attached).

 

When I do test for the Pattern Matching using the OCR’ed data (while creating token), I get the right results but when I run the session, QF doesn’t return right results. For example, this regular expression: \bInvoice No\b.*(.....[\d*]) ==>  should return the values after the key word ‘Invoice No’. This works fine with I do test while creating  token but when I run this using the ‘Test this Process’ or by running the Quickfields session, it return the very last digits in the image.

 

Please see the Quickfields session and test images attached (under the attached .msg file).

 

Note: I hope laserfiche wouldn't mind sharing .lfb and .qex files here.


Can some please advise that where am I doing it wrong?

 

Thanks in advance.

0 0

Answer

SELECTED ANSWER
replied on October 1, 2014 Show version history

Your pattern works correctly. The .* part translates to "any characters and it matches as much as possible, which is all the text on the page after "Invoice No."

Use a less greedy one instead. Something like: Invoice No\.\s*(\d+)

 

Edit: As far as sharing files goes, we usually remove them when there is too much personal information in them. Answers is a public site and does not require login to see these files. For ex, in the briefcase and Quick Fields session you attached, there is information about the repository name, the Laserfiche server name, the template structure, field names, ID, types and security (and any field values if list fields are used), the named of the user who was logged into the machine using Quick Fields, the folder path to retrieve documents from and send documents to. Are you ok with sharing that on a public site?

1 0
replied on October 2, 2014

Hi Miruna,

 

Thanks for you help. All working perfect. My new expressions are:

\bInvoice No\.\s*(\d+)

\bDate\b.*(\d\d/\d\d/\d\d\d\d)

\bTotal Net Amount\b\s*(.\d)(.)(\d+)
\bTotal VAT Amount\b\s*\£\s*(.\d)(.)(\d+)
\bInvoice Total\b\s*\£\s*(.\d)(.)(\d+)

 

I did try \s but I was using it as '\s\s\s' instead of '\s*'. The annoying thing was, my expressions with '.*' were working when I was doing a test while creating a token and defining regular expression but when I was running the session it wasn't working.

 

But anyways, everything is fine now.

 

Thanks for your help.

 

Note: The files I shared were test documents and sharing of the template fileds wasn't a problem either. But I have just take the attachment off now.

0 0

Replies

You are not allowed to reply in this post.
You are not allowed to follow up in this post.

Sign in to reply to this post.