Regex Parse – varying character lengths & endi…

I have a listing of data that I need to parse from. Unfortunately the names or IDs I want have varying lengths. My goal is to have

1. the type of activity, i.e. Edit Vendor or Approve Vendor in one column.

2. The digits that following the Vendor ID in a column and

3. All characters that follow ‘Vendor Name’ and occur before the ‘Primary Payment type’ string begins, in one column. Example of strings below:

 

Ex 1: Edit Vendor [VendorID=2663641752479 VendorName=JOHN FAKE DOE PrimaryPaymentType=ACH

Ex 2: Approve Vendor [VendorID =250092118591 VendorName =FAKE COMPANY Primary PaymentType =ACH

 

I was able to solve goal #2 with the following regex: (.*?=)(d*)(.*) output being: 2663641752479

and then used a subsequent regex parse to extract the string to fulfill goal #1 , (w*sw*). output being: Edit Vendor

I am struggling to achieve #3 as the Vendor Names vary in length and I have not figured out how to end the parse upon Regex seeing the word Primary. Desired output would be JOHN FAKE DOE

 

Any thoughts on improvements to my technique and/or how to accomplish #3 would be much appreciated! I am new to Regex parsing. 

 

Thank you

 

Read more here: Source link