I have Youtube and Dailymotion Video URL as follows:
For Youtube
- http://www.youtube.com/v/0PsnoiwMrhA
- http://www.youtube.com/watch?v=ok_VQ8I7g6I
- http://www.youtube.com/watch?v=1taai0d1FXw&list=PL1uGXsv9VLdCm_LYVa9c7Rv8DPdflJZfT
For Dailymotion
- http://www.dailymotion.com/video/x21a1i8_brazil-1-7-germany-a-world-cup-2014-brick-by-brick-video-animation_news
- http://www.dailymotion.com/video/x2148xg_brazil-1-7-germany-brazil-player-ratings-from-a-shocking-defeat_sport
I want to get the Preview image of these video, So i have to parse these link as follows:
For Youtube
- http://img.youtube.com/vi/0PsnoiwMrhA/default.jpg
- http://img.youtube.com/vi/ok_VQ8I7g6I/default.jpg
- http://img.youtube.com/vi/1taai0d1FXw/default.jpg
For Dailymotion
- http://www.dailymotion.com/thumbnail/video/x21a1i8_brazil-1-7-germany-a-world-cup-2014-brick-by-brick-video-animation_news
- http://www.dailymotion.com/thumbnail/video/x2148xg_brazil-1-7-germany-brazil-player-ratings-from-a-shocking-defeat_sport
Please help me. I'm newbie in regex...
YouTube:
DailyMotion:
A simple string replace would do, but here is the regex: