Alteryx Designer Desktop Discussions

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

Split alphanumeric string using Regex

Noob_1-800
5 - Atom

Hi - 

 

I have a dataset with the following column

 

ABCD1234

ABCDE1345

ABCDEX2345

 

The alpabets can vary, but the numeric length is always 4 character 

2 REPLIES 2
binuacs
20 - Arcturus

@Noob_1-800 One way of doing this

binuacs_0-1684619721045.png

 

Yoshiro_Fujimori
15 - Aurora

@Noob_1-800 ,

 

If the numeric length is always 4 characters, you don't need to use RegEx function.

Here are two ways. (As RegEx requires more resources in general, I would recommend another option.)

 

Using RegEx

NumericData = REGEX_Replace([Data], "[a-zA-Z]+", "")

AlphabeticData = REGEX_Replace([Data], "\d+", "")

 

Without RegEx

NumericData = Right([Data], 4)

AlphabeticData = Substring([Data],0,Length([Data])-4)

 

Output

Yoshiro_Fujimori_0-1684619832980.png

 

Labels