user2926497
user2926497

Reputation: 535

Find a specific special character in a string- Postgres

I am trying to find special characters if present other than ' (apostrophe) and - (hyphen) in a String. Could some one tell how can I do that? The below outputs string with all the special characters.

select Test1 from test_table where test1 ~* '[^a-z0-9]';

I want to find special characters like in the below strings:

Moδ
Barφa m
zndrΘs

Upvotes: 0

Views: 1086

Answers (1)

Laurenz Albe
Laurenz Albe

Reputation: 248125

Sounds like that would simply be

where test1 ~* '[^-''a-z0-9]'

Upvotes: 1

Related Questions