Advertisement
Guest User

Untitled

a guest
Mar 24th, 2019
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.39 KB | None | 0 0
  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. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement