0

这是描述标签的示例

    <description>
    On 5th September, 2013 ICSK Junior Branch students expressed their love and respect                                for their teachers.<div align=center><img src=http://www.example.com/press//press/sep2613focus1.jpg></div> <div       align=center><img src=http://www.example.com/press//press/sep2613focus3.jpg></div>
     The  highlight of the day was address by Principal Incharge, educating children on the significance of the Day. Indeed a touching day for the teaching fraternity of ICSK. <div align=center><img src=http://www.example.com/press//press/sep2613focus4.jpg></div> More ICSK News at <a href="http://www.icsk-kw.com" target = "_blank">www.icsk-kw.com</a>
    </description>
4

1 回答 1

0

如果你真的必须使用 RegEx(这不是你首先应该做的),那么你可以使用这个(相当简单的)表达式:

// description contains the text that you provided
images = description.match(/<img src=[^>]+>/g);

images现在包含一个包含所有图像标签的数组。

于 2013-09-27T07:49:58.243 回答