Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function solve(args) {
- const inputString = args.join(' ');
- const dates = inputString.match(/\b(?<day>\d{2})([-./])(?<month>[A-Z][a-z]{2})\2(?<year>\d{4})\b/g);
- dates.forEach((strDate) => {
- const [day, month, year] = strDate.split(/[-./]/);
- console.log(`Day: ${day}, Month: ${month}, Year: ${year}`);
- });
- }
Add Comment
Please, Sign In to add comment