Skip to main content
Announcements
July 15, NEW Customer Portal: Initial launch will improve how you submit Support Cases. IMPORTANT DETAILS
cancel
Showing results for 
Search instead for 
Did you mean: 
vinaymaidargi
Contributor II
Contributor II

How to list ONLY Special Characters

Hello,

I have a list of Input first names like below

First Name:

Ajay

Ajay123$

Ajay$$$

Ajay#$%

Ajay@

$$$

$

%

&

*

@

^^^^^^^

----------

!!!!!!!

I need to pull only special characters. Even though other names has text with special character it should not display.

In this case, it should have the output as below

DESIRED OUTPUT:

First Name

$$$

$

%

&

*

@

^^^^^^^^^

-------------

!!!!!!!

I have tried to use Purgechar and Keepchar functions. In both cases, it will even list out the names which has text along with special characters.

Thanks,

Vinay

11 Replies
MarcoWedel

Glad it helped

Marco

evan_kurowski
Specialist
Specialist

Ok, went and tried Vinays original example using his sample data and it doesn't appear like there's any data above chr(127).  i.e. "no Unicode that looks like it's ascii, but isn't, a la chr(65): 'A' being a different character than chr(1040): 'А'

However Marco introduces the concept of characters above chr(127) and beyond the ascii 255 line, expanding his example to include Unicode.

Vinny can mark what he prefers (and Marco puts up plenty of fine solutions), but there's no reason Purgechar() wouldn't be suitable here so long as the original premise was lower ascii character sets.  Don't want to perpetuate fallacy.


And as mentioned, Regex could work:

[^[:punct:]\x0A\x0D]

Regex_NPP.png