I have the following regular expression:
\d{4}(-\d{2}){2}
Which is supposed to match dates that follow the YYYY-MM-DD
format, so 1990-01-01 should successfuly match. However this fails when I try it in javascript.
var x = new RegExp('\d{4}(-\d{2}){2}')
x.test('1990-02-01') //why is this false?