expresión regular correcta para obtener el valor src de la cadena.
var str = "<iframe width=\"1000\" height=\"460\" src=\"https://myvideo.dpdhl.com/video/CuEt8XJ8uVEU3MZrrjQp5z\" title=\"Test Video for New Component\"></iframe>"; var re = /^src/g; var n = str.match(re); console.log(n);// salida "https://myvideo.dpdhl.com/video/CuEt8XJ8uVEU3MZrrjQp5z" title="Video de prueba para el nuevo componente"></iframe>
Podemos intentar usar la match con el patrón regex \bsrc=\S+ :
var str = "<iframe width=\"1000\" height=\"460\" src=\"https://myvideo.dpdhl.com/video/CuEt8XJ8uVEU3MZrrjQp5z\" title=\"Test Video for New Component\"></iframe>"; var src = str.match(/\bsrc=\S+/); console.log(src);Si sabe que su entrada siempre se verá así o similar, también puede usar replace :
const str = "<iframe width=\"1000\" height=\"460\" src=\"https://myvideo.dpdhl.com/video/CuEt8XJ8uVEU3MZrrjQp5z\" title=\"Test Video for New Component\"></iframe>"; const src = str.replace(/^.*?src=\"(.*?)\".*?$/, "$1"); console.log(src);