I am unable to create a regex expression for below condition.
var1 = '123'
var2 = '-999'
var3 = '$##99$#%'
var4 = '-9999'
var5 = '-123'
var6 = '-99'`
Conditions:
- accept all integers with max length of 10 digits.
- not accept any characters or symbols.
- accept only '-999' value apart first point(only three digits).
- not accept any integers starting with '-' and other than '999'.
var1 and var2 are valid, the rest three are not valid.
This is what I tried so far:
^[-]?[0-9]{4}$
/^\d{1,10}?$/