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

assembly - What is the addressing mode for ld, add, and rjmp instructions? -

vowpalwabbit - Interpreting Vowpal Wabbit results: Why are some lines appended by "h"? -

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