Author Topic: Help with regular expression  (Read 2549 times)

0 Members and 1 Guest are viewing this topic.

Frank

  • Guest
Help with regular expression
« on: December 29, 2012, 07:31:29 PM »
Testing PDF Explorer.
I have several hundred invoices in PDF format. I would like to extract the invoice number to an Info Field.
In clear text the invoice number is identified like this:

Fakturanr.: XXXX

It is the 4 digit invoice number I would like to extract, and if possible validate if the invoicenumber has changed into 5 digits which it will do over time.

Can anyone help me with the proper Regular Expression string for this?

Kind regards Frank

RTT

  • Administrator
  • *****
  • Posts: 766
Re: Help with regular expression
« Reply #1 on: December 30, 2012, 01:57:29 AM »
If the invoice number is numeric only, try this one:

Fakturanr\.:[\x20]*(\d*)

The number will go into the 2nd capturing group, as exemplified in the attached screenshot where it is being extracted to a custom field named number.

Regarding the 5 digits validation. What kind of feedback you have in mind when that occurs?