I want to validate a number using regex.. the condition is number can be from any negative 3 digit values to positive 3 digit.. but cannot be zero.
can someone please he
There it´s It can or not start with the negative symbol, followed by a number between 1 and 9 ant then can be 0 to 2 of any number.
^\-?[1-9]\d{0,2}$
Update: And the following regex also allows decimals
^\-?[1-9]\d{0,2}(\.\d*)?$