I want user only input 0-9 and only once \".\"
patt = /[^0-9(.{1})]/ 1.2222 -> true 1.2.2 -> false (only once \'.\')
help me , t
Why not use http://php.net/manual/en/function.is-float.php ? But anyhow, the RegEx would be ^[\d]+(|\.[\d]+)$ have fun!
^[\d]+(|\.[\d]+)$