Js regularly matches the src value in img in span.

< span data-v-19af1fd2= "" contenteditable= "false" class= "face-box" >

Apr.26,2022

var str = '<span data-v-19af1fd2="" contenteditable="false" class="face-box"><img data-v-19af1fd2="" src="/static/img/emoji/2.gif" width="100%" height="100%"></span>';
var a = str.match('(?<=src=").[^"]*')
console.log(a[0]) // /static/img/emoji/2.gif

<img [^>]*src="([^"]+)"

let str= "< span data-v-19af1fd2="contenteditable=" false "class=" face-box ">


</span>';
var srcRe = /[ ]+src\=\"([^"]*)\"/;
if (srcRe.test(span)) {
    var src = RegExp.$1;
    console.log(src);
}
Menu