Alteryx Designer Desktop Discussions

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

Regex Parse Null output

MartWClimber
9 - Comet

I've created an Regex expression with regex101.com.

This expression separate the different components of a ModuleFullPath (crew list runner) into different columns.

The regex I created is as follows I created 6 groups

\\\\([A-z0-9$]+)\\([A-z0-9]+)\\([A-z0-9]+)\\([A-z0-9]+)\\([A-z0-9]+)\\([A-z0-9]+)

The ModuleFullPath consist of the following:

\\(server)\(topfolder)\(subfolder-1)\(subfolder-2)\(Altery main folder)\(Alteryx subfolder-1)\(Alteryx subfolder-2)\(optional-subfolder)\(Workflow).yxmd

 

I want to extract only the Alteryx subfolder-2. in my case this is always the 5th group.

What i don't understand is why this works on regex101 but not in Alteryx. That should be the same?

 

 

 

Note I know that this can also be done with the split to columns tool and put the \ as separator but i want to practice my Regex skills.

7 REPLIES 7
atcodedog05
22 - Nova
22 - Nova

Hi @MartWClimber 

 

Regex formula would be

 

REGEX_Replace([Input], "\\\\([A-z0-9$]+)\\([A-z0-9]+)\\([A-z0-9]+)\\([A-z0-9]+)\\([A-z0-9]+)\\([A-z0-9]+)", "$4")

 

Hope this helps : )

MartWClimber
9 - Comet

@atcodedog05  Unfortunately I get the full input string back without the split.

atcodedog05
22 - Nova
22 - Nova

Hi @MartWClimber 

 

Can you provide a sample input string.

 

 

MartWClimber
9 - Comet

@atcodedog05 I've created a sample string for this see codeblock. Also I've tested this sample string against my regex on regex101 and there it parse it (see screenshot). Also I've added the workflow from Alteryx as a screenshot

 

 

\\server01\d$\Alteryxsales\data_extract\alteryx\data\Sales\salesworkflow.yxmd

 

atcodedog05
22 - Nova
22 - Nova

Hi @MartWClimber 

 

Try regex like this

 

[^\\]  means doesn't contain \ 

 

atcodedog05_0-1644328672171.png

 

Hope this helps : )

 

binuacs
20 - Arcturus

@MartWClimber Another option using RegexTokenize method

 

binuacs_0-1644329722240.png

 

atcodedog05
22 - Nova
22 - Nova

Happy to help : ) @MartWClimber 

Cheers and have a nice day!

Labels