I am creating a noob for Android development, and I am trying to remove a string of dynamic characters from a string. My line:
"Beginning of String....<img src="http://webaddress.com" height="1" width="1"/>"
I want to remove "& lt", "& gt" and everything in between. All I want is "Beginning of the line ..." Until I tried this without success.
description = description.replaceFirst("(?s)(<)(.*?)(>)","$1$3");
I also tried this on a similar similar line, and it worked fine, so I donβt understand what I am doing wrong.
description = description.replaceFirst("(?s)(<sub>)(.*?)(</sub>)","$1$3");
My class
public class RssReader { private final static String BOLD_OPEN = "<B>"; private final static String BOLD_CLOSE = "</B>"; private final static String BREAK = "<BR>"; private final static String ITALIC_OPEN = "<I>"; private final static String ITALIC_CLOSE = "</I>"; private final static String SMALL_OPEN = "<SMALL>"; private final static String SMALL_CLOSE = "</SMALL>"; public static List<JSONObject> getLatestRssFeed(){ String feed = "http://feeds.feedburner.com/MetalMarketCommentary";
XML I understand
<item> <title>Gold Market Recap Report</title> <link>http://feedproxy.google.com/~r/MetalMarketCommentary/~3/jGYtkXdSKWs/mid-session-gold_703.html</link> <description><img src="http://www.cmegroup.com/images/1x1trans.gif?destination=http://www.cmegroup.com/education/market-commentary/metals/2012/09/mid-session-gold_703.html" alt=""/>For the week December gold forged a trading range of roughly $37 an ounce. With gold prices attimes seemingly on the rocks and poised for a downside washout it was a change of pace to see afresh upside breakout in the Friday morning trade....<img src="http://feeds.feedburner.com/~r/MetalMarketCommentary/~4/jGYtkXdSKWs" height="1" width="1"/></description> <pubDate>Fri, 21 Sep 2012 19:50:37 GMT</pubDate> <guid isPermaLink="false">http://www.cmegroup.com/education/market-commentary/metals/2012/09/mid-session-gold_703.html?source=rss</guid> <dc:date>2012-09-21T19:50:37Z</dc:date> <feedburner:origLink>http://www.cmegroup.com/education/market-commentary/metals/2012/09/mid-session-gold_703.html?source=rss</feedburner:origLink> </item>
source share