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 instead of to_number function

Igor S.Oct 14 2013 — edited Oct 14 2013

Good dayl all,

I am trying to write a query to check if something is a number. So far I got this

select 1

  from dual

where regexp_like(1.1, '^[\+\-]?[0-9]*\.?[0-9]+$');

But it wont work for floating numbers and I am not sure why.

[\+\-]?   -- This should mean match + or - o or 1 time

[0-9]*    -- Match number 0 or more times

\.?       -- Match dot 0 or 1 time

[0-9]+    -- Match number 1 or more times


Best regards,

Igor

This post has been answered by BluShadow on Oct 14 2013
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Nov 11 2013
Added on Oct 14 2013
15 comments
1,331 views