I have to match string like "DAY1","DAY2","DAY3"....."DAY31"
with regex in vb.net. I tried something like this - ^?DAY(0[1-9]|[12][0-9]|3[01])$
but it did not work. Please help.
The pattern should have succesfull match if the source string is either DAY1
or DAY2
or DAY3
to DAY31
like so.
Try following regex (removed the ?
and the 0
before the first number):
^DAY([1-9]|[12][0-9]|3[01])$