sql – Regex to identify all “special” characters

I have a table, sales, with a column, email_address. I want to filter to only include records in the sales table that have any characters that are neither alphanumeric nor special characters. These include A-Z (lower/upper), characters with accents and tildes, 0-9, and the following:

`~!@#$%^&*()_-+={}[]|\:";'<>,.?/

Right now, I am using the following:

select *
from db.sales
where email_address !~ '^[.a-zA-Z0-9!@#$%^&*()_\+={}\[\]|\\;:\"<>\,\./?\-]'
AND email_addr !~ '[[alphanum]]'

Unfortunately, entries like these are getting picked up:

I’m trying to figure out, how do I remove those fields which have “standard” characters, and only filter for those with “non-standard” characters (e.g., emojis, mathematical symbols)?

Read more here: Source link