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 | Leave a comment

   

%d bloggers like this: