Solved

# date range ...

Posted on 2011-03-16

Hi experts. Regular expressions are, to be perfectly honest with you, a bit of a black art to me, so I don't even know where to start.

Basically this is what I want to do. I have two dates presented to me as strings in

"YYYY-MM-DD" format

What I want to be able to do is use a regular expression that recognises any other date that falls within the range specified by the two dates I got.

I trust this is somewhat helped by the fact that if you write any dates out as numbers like YYYYMMDD, the > and < operators would always work. so if date 3 falls between date 1 and date 2, then the YYYYMMDD representations of these three dates also follow a simple numeric comparison.

But how do you express that in "regular expressions"?

cheeeeers.