title: How to check if string contains date using regular expression?
body: <p>I have files where my logs are in multiple lines every logged event has date, I am trying to write logic
  if line start with the date and
  if second line dont
  have date merge with first line thats the end goal, below code as first step printing lines that has dates vs no dates but it always print
  else statement,
      any idea what is implement wrong ?</p>
  
  <p>My question is not about validation of date Object i just want to check if string contains date any format print those lines.Issue is i want to combine multiple lines og event using date parameter.</p>
  
  <p>ctrl.js</p>
  
  <pre><code>fs.readFile(dir + '/' + logFile, 'utf8', function(err, data) {
      var line = data.split('\n');
      var messageDateInfo = line.split('|')[0].replace(/[\[\]']+/g, '');
      var d = parseDate(messageDateInfo);
  
      function parseDate(str) {
          var m = str.match(/^(\d{1,2})\/(\d{1,2})\/(\d{4})$/);
          return (m) ? new Date(m[3], m[2] - 1, m[1]) : null;
      }
      if (line.includes(d)) {
          console.log('print lines with date', line);
      } else {
          console.log('print lines without date', line);
      }
  });
  </code></pre>
  
  <p>fileData </p>
  
  <pre><code>[2017-03-23T18:13:16Z]|verbose|bmid: n/a|infra.topicWorkers|topology changed, emitting topology event { newTopology: 
     [ '-0000001337',
       '-0000001338',
       '-0000001339',
       '-0000001340',
       '-0000001341',
       '-0000001342' ],
    oldTopology: 
     [ '-0000001337',
       '-0000001338',
       '-0000001339',
       '-0000001340',
       '-0000001341' ],
    workerId: 6,
    pid: 30488 }
  [2017-03-23T18:13:16Z]|verbose|bmid: n/a|infra.topicWorkers|topology changed, emitting topology event { newTopology: 
     [ '-0000001337',
       '-0000001338',
       '-0000001339',
       '-0000001340',
       '-0000001341',
       '-0000001342' ],
    oldTopology: [],
    workerId: 4,
  </code></pre>