Tuesday, September 7, 2010

datecheck

string _strdatePtrn = @"(^((((0[1-9])

([1-2][0-9])
(3[0-1]))
([1-9]))\x2F(((0[1-9])
(1[0-2]))
([1-9]))\x2F(([0-9]{2})
(((19)
([2]([0]{1})))([0-7]{1})([0-9]{1}))))$)";

2 comments:

  1. ^(0[1-9]|1[0-2])\/((0[1-9]|2\d)|3[0-1])\/(19\d\d|20[0-7][0-9])$

    regex to accept 1900 - 2079 years

    ReplyDelete
  2. use this regex tester

    simple
    1. http://www.codeproject.com/KB/recipes/RegexTester.aspx

    complex
    2. http://www.codeproject.com/KB/string/regextester.aspx

    ReplyDelete