When js uses regular expressions to match img tags, the match does not match

in the project, use regular matching img tags in the article. There is obviously img in the string passed in, but it is empty with regular matching. Baidu has searched a lot of regular expressions matching pictures, but still can"t match them. imgReg = / ^ ( |\ / >)) | (src= [\"\ "]? ([^\"\"] *) [\"\ "?) $/ gi; this is the rule I found. Ask all the gods for help


can't I just match the tags? And make sure there's a path inside?
var r = / ^ $/ gi


<img[^>]*>
Menu