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!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

Regular expression help for matching numbers

ash0602Aug 6 2010 — edited Aug 6 2010
Hi,

I want a exact match of either 9 digits or 12 digits, my query should give "No Match Found" as the input value is actually 10 digit

select case when regexp_like(regexp_replace( ' 123 4567 890', ' ' ), '^([0-9]{9})|([0-9]{12})$')
then 'Match Found'
else 'No Match Found'
end as test
from dual;

Need help, as I must be doing something very basic thing, wrong.

Regards,
Ash
This post has been answered by Hoek on Aug 6 2010
Jump to Answer

Comments

Processing
Locked Post
New comments cannot be posted to this locked post.

Post Details

Locked on Sep 3 2010
Added on Aug 6 2010
4 comments
3,465 views