community
cancel
Showing results for 
Search instead for 
Did you mean: 

Alteryx designer Discussions

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

REGex Replace

Meteoroid

I'm trying to extract the following 

 

SourceResult
RIS T/F FROM 42956200004295620000
RES TF FROM 8233040415-PC8233040415-PC
228880217-01 residual t/f228880217-01
4214690617 REFUND RESIDUAL MOV4214690617
Resid Trf- 16-01355416-013554
4273700000-ST.Thomas GGG4273700000
4273700000-PC-ST.Thomas GGG4273700000-PC
Alteryx Certified Partner
Alteryx Certified Partner

Hi @SYang1 

 

Why doesn't "4273700000-ST.Thomas GGG " result on 4273700000-ST?

 

Could you give more details about the logic?

 

Cheers,

 

Alteryx
Alteryx

Hi @SYang1 

 

This formula looks like it works:

 

(\d+(?:-\d+)*(?:-PC)?)

 

Regex.png

Alteryx Certified Partner
Alteryx Certified Partner

This also works

REGEX_Replace([Source], ".*?(\d+)(-(?:\d+|PC))?.*", "$1$2")

 

example1.PNG

 

Cheers,

Labels