I've just inherited a projected with a lot of client side validation.
In this I have found a regex checker, as expected without a comment in sight. I'll admit regex is definitely one of my failing points. (In Javascript!)
var myRegxp = /(([0]*[1-9]{1})|([1]{1}[0-2]{1}))(\/{1})((19[0-9]{2})|([2-9]{1}[0-9]{3}))$/;
if (!myRegxp.test(args.Value))
{//do fail stuff here};
I'm pretty sure from the rest of the page that it's supposed to be checking for some sort of date format. Would this pass MM/YYYY. From some early testing, it almost does it.
If this regex doesn't match MM/YYYY, what would be the best way to do this?
Any advice from the regex masters would be appreciated.