This question has been asked before and I found this:
Reg exp for youtube link
but I\'m looking for something slightly different.
I need to match th
It's a bit late, but I wrote this regex today and it does not only identify the links but returns the video_id via match-group 6
^(https?\:\/\/)?(www\.)?(youtube\.com|youtu\.?be)(\/)?(watch\?v=|\?v=)?(.*)$
https://gist.github.com/Shibizle/3c6707911ea716860786728d31f8e3e5
Test it: https://regex101.com/r/l0m7yh/1
Picture: Regex YouTube