Important Community update: The process for changing your account details was updated on June 25th. Learn how this impacts your Community experience and the actions we suggest you take to secure your account here.

Alteryx Designer Desktop Discussions

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

Regex Expression

BRRLL99
11 - Bolide

Hi

I have following data

 

/tenants/ct/108251/prod/rec/processing/apac_me/GLASS_CDGL_APAC_MONTHLY_20220831_CD01_20220901222348-EXCEPTION_20220901222916.CSV

 

I'm looking for

output ex:1

/tenants/ct/108251/prod/rec/processing/apac_me/GLASS_CDGL_APAC_MONTHLY_20220831_CD01-EXCEPTION_.CSV

 

After receiving output ex:1,

output ex:1 should used  for another regex output to get

 

/tenants/ct/108251/prod/rec/processing/apac_me/GLASS_CDGL_APAC_MONTHLY_CD01-EXCEPTION.CSV

 

 

3 REPLIES 3
apathetichell
18 - Pollux

out1:

regex_replace([fieldname],"(.*CD01_)\d+(-EXCEPTION_)\d+(.*$)","$1$2$3",1)

 

out2:

regex_replace([out1],"(.*_)\d+(.*)$","$1$2")

 

BRRLL99
11 - Bolide

Hi 

thank you for your reply,

i made a slight mistake in my question

can you work on this please 

 

data:

/tenants/ct/108251/prod/rec/processing/apac_me/GLASS_CDGL_APAC_MONTHLY_20220831_CD01_-EXCEPTION_.CSV

 

required output: /tenants/ct/108251/prod/rec/processing/apac_me/GLASS_CDGL_APAC_MONTHLY_CD01-EXCEPTION.CSV

Emmanuel_G
13 - Pulsar

@BRRLL99 

 

Hope you're fine. 🙂

 

Find attached the good regex expressions for this case.

 

Let me know if you meet any issue and do not hesitate to mark this answer as solution if it helped.

 

Emmanuel_G_0-1663715097910.png

 

Labels