Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

REGEXP_LIKE check for invalid characters

845908Mar 21 2011 — edited Mar 21 2011
I'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?
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Apr 18 2011
Added on Mar 21 2011
3 comments
5,134 views