Nice code, smarter than I am so I am not sure if my next suggestion is valid.
It appears to me that the link characters you have defined are a-z, A-Z,0-9.
What if a link character is not contained within your definition?
Hi, Rik. Below is the describtion from the code coach, it says the information to be extract is the at the end of the link, which is a combination of letters and nummbers. I have one test out of five failed.
YouTube Link Finder
You and your friends like to share YouTube links all throughout the day. You want to keep track of all the videos you watch in your own personal notepad, but you find that keeping the entire link is unnecessary.
Keep the video ID (the combination of letters and numbers at the end of the link) in your notepad to slim down the URL.
Create a program that parses through a link, extracts and outputs the YouTube video ID.
A string containing the URL to a YouTube video. The format of the string can be in "https://www.youtube.com/watch?v=kbxkq_w51PM" or the shortened "https://youtu.be/KMBBjzp5hdc" format.
A string containing the extracted YouTube video id.