Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function solve(input){
- let dates = input;
- let pattern = /(?<day>\d{2})([-.\/])(?<month>[A-Z][a-z]{2})\2(?<year>\d{4})/g;
- while((validDt = pattern.exec(dates))!==null){
- let days = validDt.groups['day'];
- let months = validDt.groups['month'];
- let years = validDt.groups['year'];
- console.log(`Day: ${days}, Month: ${months}, Year: ${years}`);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement