I’m not really good with regular expressions, so I’m hoping someone could help come up with something that would fit what I’m trying to do, which is:
I want it to match in the following cases (only for youtube links):
http://www.youtube.com/watch?v=oHg5SJYRHA0
http://www.youtube.com/watch?v=oHg5SJYRHA0
youtube.com/watch?v=oHg5SJYRHA0
http://youtu.be/oHg5SJYRHA0
http://www.youtu.be/oHg5SJYRHA0
youtu.be/oHg5SJYRHA0
also in the first three examples, it should match any domain ending, so not just .com
While I’m asking this, I will also need to be able to get the video ID alone as well.
You could do the following: