title: How to find right regex for date?
body: <p>I have a date like this: "2019" and i want to find a regex for it in javascript. my code return false at all. can you help me please ?</p>
  
  <pre><code>let regex = new RegExp('\d{4}');
  if regex.test("2019"){
      console.log("true");
  } else {
      console.log("false");
  }
  </code></pre>