Skip to content

Instantly share code, notes, and snippets.

@senthilsweb
Created March 28, 2021 02:13
Show Gist options
  • Save senthilsweb/a67839c9e447bba6549c6595f6e5f671 to your computer and use it in GitHub Desktop.
Save senthilsweb/a67839c9e447bba6549c6595f6e5f671 to your computer and use it in GitHub Desktop.
#This is mandatory field # 1. Hard code the name of the vendor / supplier
issuer: BREB
fields:
#This is mandatory field # 2. Always hard code the below RegEx pattern
amount: GrandTotal:(\d+\.\d+)
#This is mandatory field # 3. Always hard code the below RegEx pattern
date: InvoiceDate:(\d{1,4}\-\d{1,2}\-\d{1,4})
#This is mandatory field # 4. Always hard code the below RegEx pattern
invoice_number: InvoiceNo:(\S+)
# Actual Field extracton Regualr Expression starts from here.
# Tips & key points:
# Prefix with "bp_"
# If there is no match, you will not get this attribute in the result
bp_department: (?s)\\nDepartment:(.*)\\nOperator
bp_token: \d{4}\-\d{4}\-\d{4}\-\d{4}
#"Keyword" is mandatory. Add one or more unique keyword(s) from the bills or documents in question.
keywords:
- BREB
options:
remove_whitespace: false
#---------------------------------------------
# Important: For this template to work, the below dummy one line string should present in the "Text" on which the RegEx going to be applied
#[*****->Dynamic content (start)] GrandTotal:319.00 InvoiceDate:20-10-2015 InvoiceNo:#BLR_WFLD20151000982590 [<-*****Dynamic content (end)]
#---------------------------------------------
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment