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
"[\\?&]v=([^]*)"
explained (after reduction from a JavaScript string to a regex):
[\?&] # Match a ? or a & (the backslash is unnecessary here!)
v= # Match the literal text "v="
( # Capture the following into backreference no. 1:
[^]* # Zero or more characters except & or #
) # End of capturing group.
The second regex [^http://youtu.be/](.*)[^?hd=1]
is very wrong.
It probably should read
"^http://youtu.be/(.*)(?=hd=1)"