Try using jsoup
html parsing api to with dedicated functionality for html parsing and would also provide for an extensible solution.
For your case (I escape quotes and additional \
to make it a valid Java
string):
String str = "Getting better doesn’t stop because it’s getting colder. The best athletes don’t just overcome the elements, they embrace them with Nike Hyperwarm. Gear up for winter: <a href=\"/l.php?u=http%3A%2F%2Fwww.nike.com%2Fhyperwarm&h=4AQEBIq17&s=1\" rel=\"nofollow nofollow\" target=\"_blank\" onmouseover=\"LinkshimAsyncLink.swap(this, "http:\\/\\/www.nike.com\\/hyperwarm");\" onclick=\"LinkshimAsyncLink.swap(this, "\\/l.php?u=http\u00253A\u00252F\u00252Fwww.nike.com\u00252Fhyperwarm&h=4AQEBIq17&s=1");\">http://www.nike.com/hyperwarm</a><br/><br/><a href=\"http://www.facebook.com/photo.php?v=10151882076318445\" id=\"\" title=\"\" target=\"\" onclick=\"\" style=\"\"><img class=\"img\" src=\"http://vthumb.ak.fbcdn.net/hvthumb-ak-ash3/t15/1095964_10151882078663445_10151882076318445_40450_2013_b.jpg\" alt=\"\" style=\"height:90px;\" /></a><br/><a href=\"http://www.facebook.com/photo.php?v=10151882076318445\" id=\"\" style=\"\">Winning in a Winter Wonderland</a>\"";
Document doc = Jsoup.parse(str);
Element element = doc.select("img").first();
System.out.println(element.attr("src"));
Element element2 = doc.select("a").first(); // Get the anchor tag element
System.out.println(element2.attr("onclick")); // onclick as attribute for anchor tag
Output;
http://vthumb.ak.fbcdn.net/hvthumb-ak-ash3/t15/1095964_10151882078663445_10151882076318445_40450_2013_b.jpg