使用正则表达式从数组中删除不需要的html [关闭]

I have a long string in which there is some relevant text that i want to extract and some unwanted html tags. This html tags are not present in all the strings in the array.

For example,

 "description\":\"SOME RELEVANT TEXT...<img width='1' height='1' src='http:\/\/someurl.com.feedsportal.com\/c\/33818\/f\/608449\/s\/1c52b2b5\/mf.gif' border='0'\/><div class='mf-viral'><table border='0'><tr><td valign='middle'><a href=\\\"http:\/\/share.feedsportal.com\/viral\/sendEmail.cfm?lang=en&title=some_title&link=http%3A%2F%2Fwww.someurl.com%2Fworld-newssome_title%2FArticle1-805340.aspx\\\" target=\\\"_blank\\\"><img src=\\\"http:\/\/res3.feedsportal.com\/images\/emailthis2.gif\\\" border=\\\"0\\\" \/><\/a><\/td>"

In the above string, I only want to extract "SOME RELEVANT TEXT..."

PHP or JS?

JS: http://jsfiddle.net/mplungjan/fpzEn/

var str =  "description\":\"SOME RELEVANT TEXT...<img width='1' height='1' src='http:\/\/someurl.com.feedsportal.com\/c\/33818\/f\/608449\/s\/1c52b2b5\/mf.gif' border='0'\/><div class='mf-viral'><table border='0'><tr><td valign='middle'><a href=\\\"http:\/\/share.feedsportal.com\/viral\/sendEmail.cfm?lang=en&title=some_title&link=http%3A%2F%2Fwww.someurl.com%2Fworld-newssome_title%2FArticle1-805340.aspx\\\" target=\\\"_blank\\\"><img src=\\\"http:\/\/res3.feedsportal.com\/images\/emailthis2.gif\\\" border=\\\"0\\\" \/><\/a><\/td>"

alert(str.split(/description":"/)[1].split(/</)[0])

This will remove all tags from the text, but not sure if that is what you want.

<script type="text/javascript">   
    var regex = /(<([^>]+)>)/ig;
    var body = "Your text with tags in <br> it<br>";
    var result = body.replace(regex, "");
</script>

Or with jQuery

$('Your text with tags in <br> it<br>').text()