I want to validate european date formats like \"10.02.2012\" or \"10-02-2012\". Therefore I created the following regex:
/\\d[0-9]{2}(.|-)\\d[0-9]{2}(.|-)\\d
It works correctly after minor modifications :
\d{2}(\.|-)\d{2}(\.|-)\d{4}
the "." needs to be escaped.
\d is same as [0-9] , no need to repeat it.
http://regexr.com?326f2