I would like a way to validate a string, it needs to have only letters and uppercase; but I could not find a way to do that.
1 Answer
Check for all records where the value 'record' matches only upper or lowercase letters from a-z
SELECT value FROM values WHERE value ~ '[A-Za-z]';
4 Comments
Wendel Santos
Perfect, this solves my problem, but I need it to be just the lyrics; special characters like 'ÉÈÇÊ' and so on can not be in my string
Alan Kavanagh
does [a-zA-Z] return values containing 'ÉÈÇÊ' ?
Wendel Santos
shall not contain such characters; once inside the string has one of these; I need a false return.
Wendel Santos
Only accept the space character and the following characters in parentheses: (ABCDEFGHIJKLMNOPQRSTUVWXYZ 0123456789 ª º - /.,).