I have one text input.
I wrote a regex for masking all special characters except . and -. Now if by mistake the user enters two .
.
-
if you just want to handle number ,you can try this:
valueTest.match(/^-?\d+(\.\d+)?$/)