I am validating dates using regular expression in javascript. The regular expression I am using is
/^(((((0?[1-9])|(1\d)|(2[0-8]))\/((0?[1-9])|(1[0-2])))|((31\/((0?[13578])|(1[02])))|((29|30)\/((0?[1,3-9])|(1[0-2])))))\/((20[0-9][0-9])|(19[0-9][0-9])))|((29\/02\/(19|20)(([02468][048])|([13579][26]))))$/
This matches dates accurately but it would match values such as 1/1/2001ff even though I am using $ to mark the end of string. But if I give values like ff1/1/2001 it would invalidate it. So it's considering the start of the string and ignore the end of string part.
Does anyone know the reason for this.