Skip to main content

Code invoices automatically using regex string matching

Yokoy Invoice allows you to automatically code invoices, assigning submitters, cost objects, and categories based on extracted data.

Written by Yokoy Team
Updated over 2 months ago

You can use regular expressions to detect information on invoices that can be used to automatically code invoices. You set up a string matching rule containing regex syntax to determine a pattern in the extracted information.

Using that rule, Yokoy scans every uploaded PDF invoice for a string that matches the syntax defined in the regex pattern. It then compares this string with the values of the matched object attribute across all object records. If a match is found, the corresponding object is retrieved and populated in the defined target field.

Using regex rules, you can:

When you set up a string-matching (regex) rule, you define:

Field

Description

Regex syntax

Regex expressions is a special type of language that allows us to recognize certain patterns.
Let’s say that you have a book and in this book you want to find the word that contains the numbers 567 followed by a certain alphabetical number of letters, like APPLE (the string would be 567APPLE). Regex allow you to write a certain syntax pattern to extract exactly that exact string pattern from the data.


You can test the pattern directly from the setup. It checks that the pattern contains correct regular expression syntax.

Matched object attribute

Specifies the data field Yokoy checks against the string extracted by the regex from the invoice. This can be specific fields from the user profile, cost object, or category.

Target invoice field placement

Specifies where the target field is located. This can be in the invoice header or the invoice line item.

Target invoice field

Indicates the invoice field to which the matched value is assigned. It can be submitter, cost object or category.

Note: If you are unsure what regular expression would work for your specific case, you can use online tools such as regex101 to create your regular expression or reach out to Yokoy.

When all mandatory fields have been successfully configured, you can activate your newly created configuration.

Did this answer your question?