I'm trying to create a regular expression using javascript for react application that allow negative and positive decimal numbers and not allow enter any character.
I've been looking for examples, reading documentation but I dont know how make it.
This are the things that have to do:
allow negative and positive decimal numbers, I found this:
var re = new RegExp("^[+-]?[0-9]{0,900}(?:\.[0-9]{0,900})?$");
but I can write a character and show me true and add other character and show me false. console.log(re.test(value));
if is decimal and starts with zero show zero (0.232) and dont allow this (.232)
dont allow write characters, I've seen this /^\d*$/