How do I generate regex for -1.*** to 1.*** in javascript
I am looking for a regex expression that will allow entry from -1.*** to 1.***.
i.e. from negative of 1 that allows upto 3 digit after decimal (that can be any digit from 1 to 9) TO positive of 1 (that allows upto 3 digit after decimal that can be any digit from 1 to 9).
i.e. from negative of 1 that allows upto 3 digit after decimal (that can be any digit from 1 to 9) TO positive of 1 (that allows upto 3 digit after decimal that can be any digit from 1 to 9).
Example of entry that should be allowed:
-1.999, -1.987, -1.234, 0.123, 0.567, 0.987. 0.999, 1.543. 1.999
Example of entry that should not be allowed:
-2.000, -2.987, -9.987, -2.001
How can this be done?
What I have tried:
Tried on few links: regex101.com/r/5TxLfU/1[^]
Not able to get the correct answer.
Read more here: Source link
