”123 <img src="/assets/emoji/smirk.png" class="chat-emoji"> 456 <img src="/assets/emoji/sunglasses.png" class="chat-emoji"> “
字符串如上, 我现在想把这两个<img src="/assets/emoji/smirk.png" class="chat-emoji"> 和 <img src="/assets/emoji/sunglasses.png" class="chat-emoji"> 匹配出来, 该怎么写?
或者简单的说 "helloxxxhelloxxxhello" 我想把这三个hello都匹配出来 该怎么写呢
PHP中文网2017-04-17 15:52:59
aa='123 <img src="/assets/emoji/smirk.png" class="chat-emoji"> 456 <img src="/assets/emoji/sunglasses.png" class="chat-emoji"> ';
bb=aa.match(/<img.*?>/g);
Relatively simple, hope it helps