Title |
Test
Find
YouTube Video Link Verifier + ID puller
|
Expression |
(?:[hH][tT]{2}[pP][sS]{0,1}:\/\/)?[wW]{0,3}\.{0,1}[yY][oO][uU][tT][uU](?:\.[bB][eE]|[bB][eE]\.[cC][oO][mM])?\/(?:(?:[wW][aA][tT][cC][hH])?(?:\/)?\?(?:.*)?[vV]=([a-zA-Z0-9--]+).*|([A-Za-z0-9--]+)) |
Description |
Verifies YouTube video links AND pulls the video ID from them in a matching group.
Works with all capitalizations.
It also matches the WHOLE link but sorts the video ID into a group.
Works with JavaScript, PHP and Python. (Not tested with any other Regex engine)
WARNING: youtu.be links have their ID group as the second group. |
Matches |
http://www.youtube.com/watch?v=something | https://www.youtube.com/watch?v=something | http://youtu.BE/something | https://www.YOUTUBE.com/watch?en=gb&vari=abc&v=something&another=yes |
Non-Matches |
http://www.anothersite.com/watch?v=something | http://www.youtube.com/wat?v=something |
Author |
Rating:
Billy Venner
|
Source |
|
Your Rating |
|