Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function easterEggs(input){
- let string = input.shift()
- let path = /(@{1,}|#{1,})(?<color>[a-z]{3,})(@{1,}|#{1,})[^A-Za-z0-9]+(\/{1,})(?<digit>[\d]+)\4/g
- let matches = string.matchAll(path)
- if(matches){
- for(let match of matches) {
- console.log(`You found ${match.groups.digit} ${match.groups.color} eggs!`)
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement