PHP Regular Expression: matches a specific number. It is a common introduction and I hope you will get some benefits.
^ [1-9] d * $ // match a positive integer
^-[1-9] d * $ // match a negative integer
^ -? [1-9] d * $ // match the integer
^ [1-9] d * | 0 $ // match a non-negative integer (positive integer 0)
^-[1-9] d * | 0 $ // match a non-positive integer (negative integer 0)
^ [1-9] d *. d * | 0. d * [1-9] d * $ // match the Positive floating point number
^-([1-9] d *. d * | 0. d * [1-9] d *) $ // match the negative floating point number
^ -? ([1-9] d *. d * | 0. d * [1-9] d * | 0 ?. 0 | 0) $ // match floating point number
^ [1-9] d *. d * | 0. d * [1-9] d * | 0 ?. 0 | 0 $ // match non-negative floating point number (Positive floating point number 0)
^ (-([1-9] d *. d * | 0. d * [1-9] d *) | 0 ?. 0 | 0 $ // match a non-Positive floating point number (negative floating point number 0)