This should be very simple (when you know the answer). From this question
I want to give the posted solution a try. My question is:
How to get the parameter
You almost had it, just need to escape special regex chars:
regex = /http\:\/\/www\.youtube\.com\/watch\?v=([\w-]{11})/; url = 'http://www.youtube.com/watch?v=Ahg6qcgoay4'; id = url.match(regex)[1]; // id = 'Ahg6qcgoay4'
Edit: Fix for regex by soupagain.