Alteryx Designer Desktop Discussions

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

Regex to find and output all special characters in a string

garaya
7 - Meteor

Hi,

 

I´m trying to parse all special characters that I´ve in the Regex expression. The goal is to obtain a string with all the characters that were found. However, I´m able to find only the first ocurrence. Please, If anyone can tell me how I can I get all the characters.

 

Regards!

4 REPLIES 4
LordNeilLord
15 - Aurora

Hey @garaya 

 

A simpler method maybe to replace the word characters with "" therefore leaving you with the special characters only

 

Capture.PNG

LukeM
Moderator
Moderator

Hi @garaya 

 

I've attached two solutions. If you'd like to learn more about regex then I always use Regex101.com to test my code.

 

Capature.PNG

 

Hope this helps. Let us know how you get on.

 

Luke

Thableaus
17 - Castor
17 - Castor

Hi @garaya 

 

Using the Replace function you can obtain what you want.

You can also use REGEX_Replace function and create a new field.

Basically, replace this expression:

([^.,:;]+) with ""

Whatever is not your special characters is replaced by an empty character. Then you're left with just your special characters.

Cheers,

garaya
7 - Meteor

Hi @LordNeilLord 

 

Thanks for replying! I tried that option, but I need a specific set of special chars.

 

Regards!

Labels