I am making a video playback website and I need to use a html5 video player to play local videos and youtube api and vimeo api to play vimeo videos. THE problem is I want to filter the link entered by the user for all 3 conditions. I tried some regex as I never used it before but was not successful. Can anyone help me giving a example showing how to separate those links for making 3 conditions
- taking out the word "youtube" out of a youtube link so that i could make a condition statement 
- same way taking out .mp4 and .ogg extension from the local video so that it can be used to be played in a html5 video player 
- same way extract the word "vimeo" from a vimeo link so that I can use a vimeo api to play vimeo videos. 
Can anyone help?
For example we input a youtube link
http://www.youtube.com/watch?v=example
Then how to get the word "youtube" out of this link?
And I uploaded a local video with file name
example.mp4
Then how can I get the extensoon mp4 from that?
 
     
    