Tuesday, January 20, 2009

Regular Expression for Date

Regular Expression for Date
^([1-9]0[1-9]1[0-2])/([1-9]0[1-9][1-2][0-9]3[01])/([1-9][0-9][0-9][0-9])$
It accepts following format
  • mm/dd/yyyy
  • m/d/yyyy

It accepts following value

  • any value of month in between 01-12 or 1-12
  • any value of day in between 01-31 or 1-31
  • any value of year in between 1000-9999

No comments:

bdnews24.com | Bangla Version

The Daily Star