RegExLib.com - The first Regular Expression Library on the Web!

Please support RegExLib Sponsors

Sponsors

Regular Expression Details

Title Test Find YouTube Video ID Extraction
Expression
http://www\.youtube\.com.*v=(?'VideoID'[^&]*)
Description
This will match a youtube url and pull the video id out into a named capture group called VideoID. It is intentionally loose on the length and content of the video id so that it doesn't break in the future if YouTube change the format.
Matches
http://www.youtube.com/watch?gl=GB&feature=topvideos&hl=en-GB&v=tin6gKecb8k | http://www.youtube.com/watch?gl=GB&feature=topvideos&v=tin6gKecb8k&hl=en-GB | http://www.youtube.com/watch?v=tin6gKecb8k
Non-Matches
http://www.youtube.com/ | http://www.othersite.com/ | http://www.youtube.com/watch?gl=GB
Author Rating: Not yet rated. Matthew Harris
Source
Your Rating
Bad Good

Enter New Comment

Title

Name

Comment

Spammers suck - we apologize. Please enter the text shown below to enable your comment (not case sensitive - try as many times as you need to if the first ones are too hard):

Existing User Comments

Title: question
Name: qurol
Date: 10/24/2011 3:49:45 PM
Comment:
nice thx for regex.. my i question how to limit youtube. with regex example speed download to be 64kb or 256kb?


Title: question
Name: qurol
Date: 10/24/2011 3:42:41 PM
Comment:
nice thx for regex.. my i question how to limit youtube. with regex example speed download to be 64kb or 256kb?


Copyright © 2001-2024, RegexAdvice.com | ASP.NET Tutorials