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.
SOLVED

Regular expression in regex tool

SH_94
11 - Bolide

Dear community, 

 

i am trying to understand the regex expression in one of the workflow and the expression as follow:

 

(.*?)(?:\$%|$)

 

Does anyone know how to interpret this expression ?

 

In addition, may i know when we would need to use tokenise and when we can use parse ?

 

Many thanks again for the help

7 REPLIES 7
atcodedog05
22 - Nova
22 - Nova

Hi @SH_94 

 

Can you provide some sample data so that we know what it's doing? There are multiple ways to Regex for a single thing.

 

binuacs
21 - Polaris

@SH_94  you can find more about RegexTokenize in the below link

 

https://inspiringingenuity.net/2014/06/11/alteryx-regular-expression-tokenize/

 

atcodedog05
22 - Nova
22 - Nova

Hi @SH_94 

 

Another way to know more about a specific Regex is through using https://regexr.com/

 

Enter the expression above and it will give you the explanation below

atcodedog05_0-1641474183368.png

 

Hope this helps : )

 

 

SH_94
11 - Bolide

Hi @atcodedog05 ,

 

Below is my one of the sample data

 

IXHD$%CCC_ID$%SSS_ID$%SBBB_CARD_NO$%SS_STATUS_CODE$%CC_CODE$%UFUF_TYPE$%CUST_SUB_TTPE$%RC_CHARGE_S23EQ_NO$%XXX_CODE$%EEE_DATE$%EXXX23_eDATE$%RC_CHARGE_AMT$%SERRR_RERR_TYPE$%SERVICE_RECCC_ID$%PAY_C…

 

Basically i want to split $% as delimited and want to understand why the above complex expression is needed to split the column with the delimited $%

 

 

Thank again

atcodedog05
22 - Nova
22 - Nova

Hi @SH_94 

 

(.*?) means character before character before $%

 

(?:\$%|$) is searching for $ or $% 

 

its on tokenize which means it captures characters followed by $ or $% into each line there by spliting

 

Hope this helps : )

atcodedog05
22 - Nova
22 - Nova

Hi @SH_94 

 

Here is how I would approach 😅

atcodedog05_0-1641476704129.png

 

Hope this helps : )

 

atcodedog05
22 - Nova
22 - Nova

Happy to help : ) @SH_94 

Cheers and have a nice day!

Labels
Top Solution Authors