We are celebrating the 10-year anniversary of the Alteryx Community! Learn more and join in on the fun here.
Start Free Trial

Alteryx Designer Desktop Discussions

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

RegEx

yilingchen02
8 - Asteroid

Hi there,

 

I have extract the content after "_". For example:

 

Before:

2022_NZ_ABC

2022_NZ_DEF

2022_NZ_GHI

 

After:

ABC

DEF

GHI

 

How can I achieve this using RegEx?

 

Thanks,

Yiling

5 REPLIES 5
flying008
15 - Aurora

Hi, @yilingchen02 

 

 

 

^.*_([a-zA-Z]+?)$

 

 

flying008_0-1680233502977.png

 

录制_2023_03_31_11_34_54_674.gif

 

ShankerV
17 - Castor

Hi @yilingchen02 

 

One way of doing this.

 

ShankerV_0-1680238227395.png

 

ShankerV_0-1680238256552.png

 

 

Many thanks

Shanker V

yilingchen02
8 - Asteroid

It worked! Many thanks

yilingchen02
8 - Asteroid

Sorry one complication: when my input looks like this 2022_NZ_JK-LMN, I was expecting output "JK-LMN", but the above RegEx would return null. How can we handle inputs with hyphen?

 

THanks,

Yiling

ShankerV
17 - Castor

Hi @yilingchen02 

 

Please find the modified regex code.

 

ShankerV_0-1680271600379.png

 

Many thanks

Shanker V

Labels
Top Solution Authors