invoice-x / invoice2data

Extract structured data from PDF invoices
MIT License
1.83k stars 479 forks source link

No match on group regex results in List index out of range #528

Closed bosd closed 12 months ago

bosd commented 1 year ago

Steps to repreduce:

Create a template which matches a regex on a field which uses the group function. Example:

  partner_website:
    parser: regex
    regex: mywebsite.com
    group: first

Test it against an in voice with 1 or multiple occurunces of the text mywebsite.com. Using an invoice file without the thext mywebsite.com. results in an error: List index out of range

Expected behaviour: In case there is no match of an particular field with a group function, the processing of that field should be skipped. Not breaking the whole flow, as it is the case right now.