Regex for a number 1-31 Ruby -
Regex for a number 1-31 Ruby -
i trying match number 1-31 (inclusively).
this closest have:
([1-9]|[12]\d|3[01])
but numbers 324 accepted.
any chance there's regex out there can capture 1-31?
the next regex satisfies condition:
^([1-9]|[12][0-9]|3[01])$
demo here
ruby regex integer
Comments
Post a Comment