REGEXP_LIKE check for invalid characters
845908Mar 21 2011 — edited Mar 21 2011I'm sure this has been asked before but I can't find it.
If every character in a value is in this specified list, it should pass regexp validation. However, if any character is not in the approved list of characters, it should not pass. It seems so simple, yet I'm new to this and am having difficulties.
a-z
A-Z
the space character
period .
apostrophe '
ampersand &
comma ,
hyphen -
SELECT myfield
FROM mytable
WHERE REGEXP_LIKE(myfield, 'some expression here')
This is a name field and we have some data we want to consider valid, such as:
Bob & Doug
Bob and Doug
O'Bob
Bob, Doug and friends
Mr. Bob
Can someone tell me what 'some expression here' should be?