I am using javascript for regex validation in a tool named as Logi Info Studio, which is used for generation of reports. The resultant artifacts are deployed in tomcat server. The javascript code runs on server and validates whether the date format which is submitted is valid or not. The tool supports Javascript as the scripting engine
I am expecting MM/DD/YYYY from the frontend, and have tested this on local/Stage and it works fine, However on Prod, this code fails for date ‘5/31/2024’, or any date which have 31 as the DD.
Below is the regex which I am using, Can somebody put a light on this, why this would have been happening
/^(?:(?:(?:0?[13578]|1[02])(/|-|.)31)1|(?:(?:0?[1,3-9]|1[0-2])(/?|-|.)(?:29|30)2))(?:(?:1[6-9]|[2-9]d)?2[0-9]{1}[d]{2})$|^(?:(?:0?2)(/?|-|.)(?:29)3(?:(?:(?:1[6-9]|[2-9]d)?(?:0[48]|[2468][048]|[13579][26])|(?:(?:16|[2468][048]|[3579][26])00))))$|^(?:(?:0?[1-9])|(?:1[0-2]))(/?|-|.)(?:0?[1-9]|1d|2[0-8])4(?:(?:1[6-9]|[2-9]d)?2[0-9]{1}[d]{2})$/