This question comes up a lot here.
Regular expressions are a bad way of handling this problem. Do yourself a favour and use an HTML parser of some kind.
Regexes are flaky for parsing HTML. You'll end up with a complicated expression that'll behave unexpectedly in some corner cases that will happen otherwise.
Edit: If your HTML is that simple then:
Pattern p = Pattern.compile("src\\s*=\\s*([\\"'])?([^ \\"']*)");
Matcher m = p.matcher(str);
if (m.find()) {
String src = m.group(2);
}
And there are any number of Java HTML parsers out there.