i’m setting up a directory structure based on dates: 2010/02/01
right now, my rewrite rules look something like this:
([0-9]{4})/([0-9]{2})/([0-9]{2})
I tried limiting the ranges – the month, for instance: ([01-12]{2}) – but that doesn’t seem to work. is there a way to do this, or am i making this too complicated and i shouldn’t worry about it?
i don’t want something like: (01|02|03…10|11|12)
thanks!
Regular expressions don’t see numbers as numbers. It sees each individual digit as a character. So, [01-12] would actually equivocate to [012] or [0-2]. (Someone correct me if I’m wrong on that.)
I’m not a master at RexEx, so someone might have a better solution, but here’s what I’d use:
Untested, but that should restrict your year to the 2000s, your months to 01-12, and your days to 01-31.