I need replace url from a string.
example:
var container = "hello http://www.youtube.com/watch?v=r94hrE10S84 hello";
I want replace to:
container = "hello <iframe src='//www.youtube.com/embed/r94hrE10S84' </iframe> guys";
Im trying to do:
container = container.replace("http://www.youtube.com/watch?v=(/\w*\d+\w*/)","<iframe src='//www.youtube.com/embed/$1' </iframe>");
thank you