We have the following text which represents the OCR output from an invoice. We need a regex that determines the Order number and invoice number. They are on consecutive lines and always just under the Total Invoice line. See below bold.
Write a XAML to extract them in two string variables.
From:
DEMO - Sliced Invoices
Suite 5A-1204
123 Somewhere Street
Your City AZ 12345 admin@slicedinvoices.com
To:
Test Business
123 Somewhere St
Melbourne, VIC 3000 test@test.com Invoice Number
Order Number
Invoice Date
Due Date
Total Due
Rate/Price
$85.00 Sub Total
Tax
Total Invoice INV-3337 12345
January 25, 2016
January 31, 2016
Hrs/Qty
1.00
I didnât need to generate the data table and then convert it back to text (which I had from the Get full text activity) but I think I was considering going through the data table one row at a time to start off with and then I remembered the regex code Clayton had done and also the challenge was about regex right!
hey @charliefik
Thanks for the compliment
One useful trick with Regex which I should have used in my post is âlook-aheadâ and âlook-behindâ (there is more info online)
"(?<=(abc))(.*)" //will pull everything AFTER "abc" not including "abc" "(.*)(?=(abc))" //will pull everything BEFORE "abc" not including "abc"
Also, using â((.|\n|\r)*)â will pull everyting including newline and carriage return
Thanks v much Clayton Iâm going to put useful (and vaguely understandable regex code in a file so I can look it up when I need it for now until I get better at it).