I am trying to use the following regular expression to validate a date in javascript (sorry it's a bit of a brute):
"/^(((0[1-9]|[12][0-9]|3[01])\/(0[13578]|1[02])\/((19|[2-9][0-9])[0-9]{2}))|((0[1-9]|[12][0-9]|30)\/(0[13456789]|1[012])\/((19|[2-9][0-9])[0-9]{2}))|((0[1-9]|1[0-9]|2[0-8])\/02\/((19|[2-9][0-9])[0-9]{2}))|(29\/02\/((1[6-9]|[2-9][0-9])(0[48]|[2468][048]|[13579][26])|((16|[2468][048]|[3579][26])00))))$/"
The problem is, I'm getting an Unterminated Parenthetical Javascript error. I tried using this expression in PHP with preg_match and it works fine.
A bit stumped so any help would be much appreciated!
Edit: I should add, the date I'm trying to validate would be in a dd/mm/yyyy format.
Edit 2: Sorry, I should have clarified that I'm using the jQuery validator from position-abolute.com (http://www.position-absolute.com/articles/jquery-form-validator-because-form-validation-is-a-mess/).
The custom rule I have defined is:
"date":{
"regex":"/^(((0[1-9]|[12][0-9]|3[01])\/(0[13578]|1[02])\/((19|[2-9][0-9])[0-9]{2}))|((0[1-9]|[12][0-9]|30)\/(0[13456789]|1[012])\/((19|[2-9][0-9])[0-9]{2}))|((0[1-9]|1[0-9]|2[0-8])\/02\/((19|[2-9][0-9])[0-9]{2}))|(29\/02\/((1[6-9]|[2-9][0-9])(0[48]|[2468][048]|[13579][26])|((16|[2468][048]|[3579][26])00))))$/",
"alertText":"* Invalid date, must be in DD/MM/YYYY format."}