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

c - Compilation of a code: unkown type name string -

ubuntu - Bash Script to Check That Files Are Being Created -

Php operator `break` doesn't stop while -