You are viewing limited content. For full access, please sign in.

Question

Question

Can't grab the second number, works in test, not in production (regex).

asked on July 27, 2022

I have a workflow that retrieves text with pattern matching and need to grab the second number after “AGENCY ID:”, which would be the 0000509924.

But in production, it doesn’t work. I keep getting the 0000017712, like this: 

I’ve been able to get the following regexes to work in a test environment (within the patten matching token dialog). These are the ones that worked. I have other variations of these 3, all work the same.

(?<=AGENCY ID:)\s*\d*\s*(\d{10})

(?<=AGENCY ID:)\s*\d*\s*(\d*)

(?<=AGENCY ID:)\r*\n*\n*\d{10}\n*\r*\n*(\d{10})

 

I’ve been able to determine that at least from a cut and paste into the test area that the text appears like this, but it might just be the way it has been cut and paste, no telling what characters are actually there in production.

AGENCY ID:\r\n\n0000017712\n\r\n0000509924

How can I solve this? Thanks!

0 0

Replies

replied on July 28, 2022

I figured it out!

The problem is that I was not using the iterator in my loop so it was grabbing the information from the "entire" document text, hitting the first match which would hit immediately on the first page. Just so happens that the second number on the first page is 0000017712, not 0000509924, so I got the 0000017712 over and over again. Not a regex issue at all. Thanks for replying, @████████

%(RetrieveDocumentText_Text#[%(ForEachValue_Iteration)]#)

 

1 0
replied on July 28, 2022

I didn't do it as a pattern match, but just as a token

0 0
You are not allowed to follow up in this post.

Sign in to reply to this post.