Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/regex/19.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何使用Javascript和regex将RSS提要的description标签中的多个图像解析到我的description页面_Javascript_Regex_Image_Parsing_Rss - Fatal编程技术网

如何使用Javascript和regex将RSS提要的description标签中的多个图像解析到我的description页面

如何使用Javascript和regex将RSS提要的description标签中的多个图像解析到我的description页面,javascript,regex,image,parsing,rss,Javascript,Regex,Image,Parsing,Rss,这是描述标签的示例 <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/sep261

这是描述标签的示例

    <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>

2013年9月5日,ICSK初中部学生表达了他们对老师的爱和尊重。
当天的亮点是负责人的讲话,教育孩子们认识到这一天的重要性。对于ICSK的教学兄弟会来说,这确实是一个感人的日子。更多ICSK新闻,请访问

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

// description contains the text that you provided
images = description.match(/<img src=[^>]+>/g);
//说明包含您提供的文本
images=description.match(/]+>/g);

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

感谢您的回复。我现在可以获得一张图像。我如何使用您的代码在下面使用Imageview的描述标记中显示多张图像。我尝试了while循环,但没有工作。请帮助。提前感谢var image=Ti.UI.createImageView({image:e.row.image,top:20,height:160,width:200});sv.add(image);