mod rewrite - mod_rewrite numeral ranges -


I am installing a directory structure based on date: 2010/02/01

now , My rewrite rules look something like this:

([0-9] {4}) / ([0- 9] {2}) / ([0- 9] {2})

I tried to limit the boundaries - months, for example: ([01-12] {2}) - but this does not seem to work. Is there a way to do this, or am I making it very complicated and I should not worry about it?

I do not want anything like this: (01 | 02 | 03 ... 10 | 11 | 12)

Regular expressions can not see numbers, numbers. It sees each person's number as a character. So, [01-12] will actually be equal to [012] or [0-2]. (Somebody can correct me if I am wrong on that.)

I am not a master at RexX, so anyone can have a better solution, but here I use it: / P>

  (2 \ d {3}) / (1 [0-2] | 0 [1-9]) / (3 [0-1] | [1-2] \ d | 0 [1- 9])  

unchecked, but this should limit your year to the 2000s, your months to 01-12 and your day 01-31.


Comments

Popular posts from this blog

sql - dynamically varied number of conditions in the 'where' statement using LINQ -

asp.net mvc - Dynamically Generated Ajax.BeginForm -

Debug on symbian -