0

I want to validate MM/YYYY in VB6

I used (0[1-9]|1[012])/(19|20)[0-9]{2}

But it is not working as expected. Even it allows 5 digit year.

Cœur
  • 37,241
  • 25
  • 195
  • 267
Sunny
  • 308
  • 2
  • 14
  • @Natrium It is not validating properly in VB6. It is passing 10/10/20100 – Sunny Oct 07 '16 at 11:36
  • Maybe even [Excel VBA date formats](http://stackoverflow.com/questions/19801598/excel-vba-date-formats) – Wiktor Stribiżew Oct 07 '16 at 11:36
  • I think you might want to try `^(0[1-9]|1[0-2])/(19|20)[0-9]{2}$`. You need to add `^` and `$` to your pattern. It will work to some extent. In other cases, use the other question to really validate the date. – Wiktor Stribiżew Oct 07 '16 at 11:42
  • @Sunny yes, I read the question. Look in the other question for the answer. – Natrium Oct 07 '16 at 11:54

0 Answers0