/** A friend of mine, João, very kindly pointed out a flaw in my date regex posted previously; the inability to validate the correct number of days in a month (30 or 31) */
Well, consider it done, this regex will now correctly validate days in a month as it should be (next I’ll try to cater for leap years) {
Date format is dd/mm/yy or dd/mm/yyyy (if you need US support let me know). Also note, that this regex does not use any lookbehind, so it should also work perfectly in JavaScript (which is probably where regex is used most anyway)
^(?:(?:0?[1-9])|(?:[12]\d)|(?:3(?:(?:0)|(?:1(?|(?:11))))))(?!(?:[\\.-/]\d{1,2}[\\.-/])(?:(?:[02468][048]00)|(?:(?:\d{2})?(?:(?:[2468][048])|(?:[13579][26])|(?:0[48]))))))[\\.-/](?:(?:0?[1-9])|(?:1[0-2]))[\\.-/](?:(?:\d{2})|(?:1\d{3})|(?:\d1\d{2})|(?:\d{2}1\d)|(?:\d{3}1))$
}
p.s. inevitably there will be bugs… so if you find any, let me know!