1 2 Previous Next 15 Replies Latest reply: Oct 14, 2013 11:18 AM by Hoek RSS

    Regexp_like instead of to_number function

    Igor S.

      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

        1 2 Previous Next