SHARE
TWEET

Untitled

a guest Mar 24th, 2019 60 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function matchDates(dates) {
  2.     let pattern = /b(?<day>\d{2})[-.\/](?<month>[A-Z][a-z]{2})\2(?<year>\d{4}\/+g;
  3.     while ((validDate = pattern.exec(dates)) !==null) {
  4.         let day = validDate.groups['day'];
  5.         let month = validDate.groups['month'];
  6.         let year = validDate.groups['year'];
  7.         console.log(`Day: ${day}, Month: ${month}, Year: ${year}`);
  8.        
  9.     }
  10. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top