PL/SQL REGEXP_LIKE testing string for allowed characters
- by Arino
I need to verify that the provided string has only allowed characters using Oracle regular expressions (REGEXP_LIKE).
Allowed chars are: abcdefghijklmnopqrstuvwxyz0123456789_-.
Trying to execute
SELECT CASE
WHEN REGEXP_LIKE('abcdefghijklmnopqrstuvwxyz0123456789_-.'
, '^[a-z0-9_\-\.]+$')
THEN 'true'
ELSE 'false'
END tmp
FROM dual;
results in 'false'.
Any ideas on this?