The following code is used to get Youtube video ids in order to get a thumbnail image.
What is the reasoning behind the first regular expression and what is it doing
The 1st regex is checking for "?v=GItD10Joaa0" when the url is something like "youtube.com/" and the 2nd is checking for "www.youtube.com/index?feature=youtu.be" when the url is "http://www.youtube.com/index?feature=youtu.be"
So you can simply use the 1st regex if you want to get ids from 1st url and likewise :)