Just need a little push as I have this almost working.
I want to feed jquery a URL and have it strip everthing but the video url.
Here is my code:
First, remove the $ in front of results... I assume that was a typo. Next, replace
$results = url.match("[\\?&]v=([^]*)");
with
results = url.match("[\?&]v=([^]*)")[1];
match() will return an array if there is a successful match. You're currently getting the entire array. What you want is the second element of the array (match()[1]
) which is what is inside your capturing parentheses.