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

Popular posts from this blog

Delphi change the assembly code of a running process -

json - Hibernate and Jackson (java.lang.IllegalStateException: Cannot call sendError() after the response has been committed) -

C++ 11 "class" keyword -