import java.util.regex.Matcher;
import java.util.regex.Pattern;
public class ss {
public static void main(String[] arg) {
Pattern p = Pattern.compile("<img[^>]*>",Pattern.CASE_INSENSITIVE);
Matcher m = p.matcher("one<b>dsfasdfasd</b> <IMG sdfsd src='/www/UploadFile/200608070424195331.gif' border=0> </P></TD></TR></TBODY></TABLE> +cat two cats in the yard");
StringBuffer sb = new StringBuffer();
m.find();
String img=m.group();
Pattern p1= Pattern.compile("(src)=[\"\']?.+[\"\']?[^>]\\s",Pattern.CASE_INSENSITIVE);
Matcher m2=p1.matcher(img);
m2.find();
String src=m2.group();
System.out.println(src);
// m.appendReplacement(sb, "dog");
// m.appendTail(sb);
System.out.println(sb.toString());
}
}