-1

I have a series of dates that I am trying to separate into years, months and days. These dates are in the yyyy-mm-dd format. I'm not very familiar with RegEx, but I have tried (\dddd)\-(\dd)\-(\dd).

Any help is appreciated.

Engineero
  • 12,340
  • 5
  • 53
  • 75
Brad Lee
  • 187
  • 1
  • 10

1 Answers1

0

Accepted answer would also match invalid dates like 1234-56-78, or if mm & dd were in the wrong positions.

([1-2][0-9]{3})\-([0-1][0-9])\-([0-3][0-9])

Does a little more validation.

stever
  • 1,232
  • 3
  • 13
  • 21