JSFiddle - React, Tailwind, and code Playground

HTML

<input type="text" id="input" />
http://www.youtube.com/watch?v=iol0B-clFFM

JavaScript

$(document).ready(function() {	
	var textval = $('#input');
    var youtube = /(?:youtube\.com\/(?:[^\/]+\/.+\/|(?:v|e(?:mbed)?)\/|.*[?&]v=)|youtu\.be\/)([^"&?\/ ]{11})/i;
	
	$("#input").bind('paste', function() {
            setTimeout(function() {
                if (youtube.test(textval.val())) {
                    var yurl = textval.val().match(youtube)[0];
                    alert(yurl);
                }
          
            },0);
            
		});
		
	});