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

Please support RegExLib Sponsors

Sponsors

Regular Expression Details

Title Test Find Valid YouTube links
Expression
(http://)?(www\.)?(youtube|yimg|youtu)\.([A-Za-z]{2,4}|[A-Za-z]{2}\.[A-Za-z]{2})/(watch\?v=)?[A-Za-z0-9\-_]{6,12}(&[A-Za-z0-9\-_]{1,}=[A-Za-z0-9\-_]{1,})*
Description
Matches only valid YouTube links. This includes directly linked videos (yimg) and using YouTube's shortening service (youtu.be). Also supports local domains, like youtube.nl, youtube.de, youtube.co.uk, etc.
Matches
www.youtube.co.uk/watch?v=KUlv7qraZaM | http://www.yimg.com/watch?v=KUlv7qraZaM | http://www.youtube.com/watch?v=apxKFXJ8jSg&feature=relmfu | youtu.be/apxKFXJ8jSg
Non-Matches
youtube.com/watch/v=apxKFXJ8jSg
Author Rating: Not yet rated. Pim Stoit
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

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