I have lot of files in Data base with some special character files name. So I want to fetch all files which is having special character.
I have written the blow query to fetch the files with special character.
For Example :
WHERE filename LIKE "%$%" OR filename LIKE "%!%" ;
Use regular expressions:
select fm.* from file_managed fm where filename regexp '[^a-zA-Z0-9._]'
This will look for alphanumerics, underscore, and period.
If you have a specific exclusion list, use the same idea:
select fm.* from file_managed fm where filename regexp '[[email protected]#$%^&*()]'
Just add the list between the
]. If those are invalid characters that you want to explicitly include, then use the regular expression escape character.