-3

I was checking different regEx libraries to find one that helps me validate if a random date exists, including leap years. i found the following but it's not quite working since it's not written in python and I am writing the program in Python. Here's the code:

(^(((0[1-9]|1[0-9]|2[0-8])[\/](0[1-9]|1[012]))|((29|30|31)[\/](0[13578]|1[02]))|((29|30)[\/](0[4,6,9]|11)))[\/](19|[2-9][0-9])\d\d$)|(^29[\/]02[\/](19|[2-9][0-9])(00|04|08|12|16|20|24|28|32|36|40|44|48|52|56|60|64|68|72|76|80|84|88|92|96)$)

What should I change to make it work on Python. I'm currently getting a syntax error where the last set of round parentheses starts.

JeremyK12
  • 63
  • 6

0 Answers0