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

Question

Question

Need help with Regex

asked on September 17, 2021

I have a document name 123456-569876 Invoice I need to parse out the fist 6 numbers the second set of numbers and the end document type.

Field: Invoice Number=123456

Field: Job Number=569876

Field: Document Type=Invoice

I am able to parse out the first set of numbers  using /d+ not sure how to do the rest.

 

Could use some help.

 

Thanks

 

John

0 0

Answer

SELECTED ANSWER
replied on September 17, 2021 Show version history

John,

If you are sure the syntax is going to be '123456-123456 Some Text' then you can grab the additional fields with capture groups.  The Job Number is returned with \d+-(\d+).  The Document Type is returned with \d+-\d+\s+(.+)

3 0

Replies

replied on September 20, 2021

If you're guaranteed to always have the same format, another option would be to use the Token Editor.

Assuming your two values are always separated by a dash, you could use the token editor's Split function to split on the dash character.

Then you can use the indexing option take the first index for the invoice number and last index for the job number.

 

0 0
replied on September 21, 2021

Thanks for the help worked great.

 

John

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

Sign in to reply to this post.