Bring your best ideas to the AI Use Case Contest! Enter to win 40 hours of expert engineering support and bring your vision to life using the powerful combination of Alteryx + AI. Learn more now, or go straight to the submission form.
Start Free Trial

Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.

Reg Ex needed for Bank description

kmurphy1980
5 - Atom

Hi all, 

 

We have a workflow that pulled receiving bank account numbers from a description cell string on an exported bank statement. to simplify : 

 

Old Description on BS : 

 

"BAI=575;YOUR REF=ZERO BALANCING;REMARK=/VXR/4000054089/SWEEP REF To: 6550209744 USD J.P. Morgan SE - Fr: 6550193181 USD J.P. Morgan SE - Intercompany LPQ655315214352 To: Joxer UK Limite Fr: Joxer Ireland"

 

Reg Ex to pull the "To" account number and USD was "SWEEP\sREF\sT[a-zA-Z]:\s(\d+)\s(USD)"

 

The New description on the Bank Statements is : 

 

"BAI=575;YOUR REF=ZERO BALANCING;REMARK=/VXR/4000051820/SWEEP REF /RFB/4000051810/ TO: 6550193181 USD J.P. MORGAN SE - FR: 0142505776 USD TOKYO, JAPAN INTERCOMPANY LPQ65531842881 TO: Joxer IRELAND FR: Joxer JAPAN G.K."

 

Issue : I need to update the Reg Ex to pull the "To" account number in red. Old one no longer works as there has been more descriptive text added (/RFB/4000051810/) which disrupts the matching

 

I hope this makes sense !

 

thanks. 

6 REPLIES 6
ShankerV
17 - Castor

Hi @kmurphy1980 

 

Please use the below new one.

 

SWEEP\sREF\s[a-zA-Z0-9/]+\s[a-z]{2}:\s(\d+)\s(USD)

 

Many thanks

Shanker V

binuacs
21 - Polaris

@kmurphy1980 one way of doing this

image.png

kmurphy1980
5 - Atom

Worked like a charm @ShankerV ! 

 

thank you so much. 

 

Have a great day. 

kmurphy1980
5 - Atom

Thank you so much @binuacs !

 

another way !

Amy_smart
11 - Bolide

Hi,

 

Try this REGEX with a Parse 

^.+?:\s(.+?)\s.+

 

It will just output your number.


Thanks,

Amy

flying008
15 - Aurora

Hi, @kmurphy1980 

 

(?:SWEEP\sREF.+?:\s?)([\d]+?)(?=\sUSD)

 

录制_2023_08_01_08_55_01_981.gif

Labels
Top Solution Authors