Hi all, this is how i normally check for youtube url validity using javascript. It works great but fails for urls with "-" before the video id eg http://www.youtube.com/watch?v=-pIaQpwYEjY
Any remedy available as I'm not well versed with regex
var matches = $('#as_url').val().match(/^http:\/\/(?:www\.)?youtube.com\/watch\?(?=.*v=\w+)(?:\S+)?$/);
if (matches) {
} else {
error +="\nInvalid Youtube Url";
}