ACT NOW: The Alteryx team will be retiring support for Community account recovery and Community email-change requests Early 2026. Make sure to check your account preferences in my.alteryx.com to make sure you have filled out your security questions. Learn more here
Start Free Trial

Alteryx Designer Desktop Discussions

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

REGEX, Trim everything after the first punctuation

wonka1234
10 - Fireball

Hi,

 

sample string:  This string could also contain _ , . , - . I want to trim everything after the punctuation.

ACF2.SRP.XML

 

What im getting:

ACF2SRPXML

 

my formula:

Trim(REGEX_Replace([FileName], "\W", ""))

 

What im expecting

ACF2

 

 

 

4 REPLIES 4
Matthew
11 - Bolide

this should work:

REGEX_Replace([Field1], '([\w_]*)|.*', '$1')

 

Matthew_1-1666972970401.png

 

gautiergodard
13 - Pulsar

hey @wonka1234 

Here is also a non-regex way to do it

gautiergodard_0-1666971876288.png

 

DataNath
17 - Castor
17 - Castor

Could also use RegEx in parse mode with the following which will just take everything up to the first non-word (or underscore) character:

 

DataNath_0-1666972035780.png

binu_acs
21 - Polaris

@wonka1234 One way of doing this

binuacs_0-1666996088889.png

 

Labels
Top Solution Authors