Need to find the records having special characters. the allowed characters are Hyphen, comma, forward slash(/), Hash and Dot and apostrophes (').
In the AZURE Databricks Table having few data like
L'ÎLE-PERROT -- Invalid
CHÉNÉVILLE -- Invalid
1205-RUE DE L'ACADIE - Valid
'4th Floor - InterContinental - Valid
VAL D'OR -- Valid
O'LEARY -- Valid
Bucure¿ti -- Invalid
LA DORÉ - Invalid
I tried using three methods. by using all these methods the values with apostrophes (') is skipped for validation.
By using regexp
(REGEXP(TRIM(column1 ), '[^a-zA-Z0-9,-\-/#''\s]')By using rlike
(column1 rlike '[a-zA-Z0-9\\-,/#''\\s]')By using Translate
(TRANSLATE(column1, 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789,/#. -') = '')
Check below code.
OR