In case you missed the announcement: The Alteryx One Fall Release is here! Learn more about the new features and capabilities here
ACT NOW: The Alteryx team will be retiring support for Community account recovery and Community email-change requests after December 31, 2025. Set up your security questions now so you can recover your account anytime, just log out and back in to get started. Learn more here
Start Free Trial

Alteryx Designer Desktop Discussions

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

Removing Leading and Trailing Alphabets in a string

praneshsapmm
8 - Asteroid

Hi,

 

Is there any way to remove Leading and trailing alphabets (A-Z & a-z) within the string of any length . 

 

Thanks.

5 REPLIES 5
Jonathan-Sherman
15 - Aurora
15 - Aurora

Hi @praneshsapmm,

 

You could use a regex replace function:

REGEX_Replace([Data], '^[a-z]*(.*?)[a-z]*$', '$1')

 

Kind regards,

Jonathan

Jonathan-Sherman
15 - Aurora
15 - Aurora

Also attached an example of how it would work!

 

Kind regards,

Jonathan

brandon_bunney
8 - Asteroid

Not sure what you mean exactly by "leading and trailing alphabets", but perhaps this post on stackoverflow would contain the regex pattern you are seeking?

 

https://stackoverflow.com/questions/61544656/avoid-leading-and-trailing-spaces-on-alphanumeric-strin...

praneshsapmm
8 - Asteroid

Hi @Jonathan-Sherman 

 

This works . THankyou very much . 

 

Also can you let me know the regex function to remove : 

 

1. Leading Alphabets 

2. Trailing Alphabets.

 

Thanks

 

Jonathan-Sherman
15 - Aurora
15 - Aurora

Hi @praneshsapmm,

 

The function above would remove leading and trailing alphabets, did you want a formula to do each on separately or did you mean something else?

 

Kind regards,

Jonathan

Labels
Top Solution Authors