Showing results for 
Search instead for 
Did you mean: 

Alteryx designer Discussions

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

The highly anticipated Alteryx Community tradition is back! We hope you'll join us!

Learn More
We will be upgrading the Gallery to our 2019.4 release this Saturday, December 7th beginning at 9:00am MT. We expect the outage to take last approx. 2.5 hours.

Regex help!


Trying to replace the last part of this string after the comma(XYZZA) only in cases where it doesnt end with '_General'


FY18,Other Customer,XYZZA

FY18,Other Customer,ABC_General


Current regex is below but it doesnt work as it looks for any of the letters in general, not the entire word.



Just cant seem to figure out how to use [^] condition for an entire word.


Alteryx Certified Partner

Hi @brindhan 


Solution is attached. 





By first using a REGEX_MATCH formula, we can determine whether the string ends with '_General' and take steps from there. As per the logic, if the string ends in 'General' then we will keep as is. Otherwise, remove the last part of the string after the comma. The below formula will get this done:

if regex_match([Field1], '^.*_General$') then [Field1]
else regex_replace([Field1], '(.*,).*', '$1')


Hope this helps!


This is awesome, thanks @lmorrell !