Cyberiafreak

"Fortunate are those who take the first steps.” ― Paulo Coelho

Regular Expression in Oracle-Validation so simple !

— Only alpha numberic

select regexp_instr(‘aaaABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789’,‘^[a-zA-Z0-9]*$’) from dual;

 

— Only alpha numberic + ‘space’

select regexp_instr(‘aaaABCDEFGHIJKLMNOPQRSTUVWXYZ 0123456789’,‘^[a-zA-Z0-9 ]*$’) from dual;

 

 

— Only alpha numberic + ‘space’ + ‘+’

select regexp_instr(‘aaaABCDEFGHIJKLMNO+PQRSTUVWXYZ 0123456789’,‘^[a-zA-Z0-9 +]*$’) from dual;

 

— Only alpha numberic + ‘space’ + ‘+-.’

select regexp_instr(‘abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ+-.0123456789’,‘^[a-zA-Z0-9 +-.]*$’) from dual;

 

— Only numberic + ‘space’ + ‘+-.’

select regexp_instr(‘+-.0123456789’,‘^[0-9 +-.]*$’) from dual;

 

— Only numberic + ‘@ .’

select regexp_instr(‘mahesh@ms.com’,‘^[a-zA-Z0-9@.]*$’) from dual;

Advertisements

June 9, 2010 - Posted by | Uncategorized

No comments yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: