How to validate Youtube, Dailymotion, Metacafe and Vimeo video URL with JQuery

Most of the people struct to write regular expression to validate the given url valid or not. So that today we will have tutorial about validate Youtube, Dailymotion, Metacafe and Vimeo video url with Jquery regular expression.

It validate the following type of urls

  • https://www.youtube.com/watch?v=dZpc936_Hgo
  • http://youtu.be/lvOFck4dn_8
  • http://vimeo.com/65484727
  • http://www.metacafe.com/watch/10599819/are_katy_perry_and_john_mayer_back_together
  • http://www.dailymotion.com/video/xzdijh_hire-data-entry-expert_news

Jquery Regex:

How to validate:

validation done by test() method.

It is a simple code but it is most useful for developers.

 

  • http://haydaycheatss.net hay day cheats

    Excellent article! We are linking to this great post on our site.

    Keep up the great writing.

  • http://need-for-speed-world-hacks.blogspot.com/ last snatch world

    Great blog you have here.. It’s difficult to find high quality
    writing like yours these days. I really appreciate people like you!
    Take care!!

  • http://www.GABPULSE.US Madeleine

    Great post. I’m facing some of these issues as well..