Regular Expression for minimum value 18 and maximum 99 with leading zero. Means my number should be from 18 to 99. With one condition of leading zero ie 18 == 018, 99 == 099
^0?1[89]|0?[2-9][0-9]$
Try this it will help you
Less than 18 and greater than 99 is not allowed
^(1[89]|[2-9][0-9])$
(01[89])|(0[2-9]\\d)
(01[89])
matches 018 to 019 (0[2-9]\\d)
matches 020 to 099
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.