import java.text.ParseException;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
public class Test {
public static void main(String[] args) throws ParseException {
Pattern p = Pattern.compile("(http://)?(([^/ ]+/)+)([^ ]+)");
Matcher m = p
.matcher("http://server.php/b/x/123.jpg server/b/x/黄彪.x.jpg server/b/x/Yahoo.jpg");
while (m.find()) {
String protocol = m.group(1) == null ? "" : m.group(1);
System.out.println(protocol + m.group(2) + " => " + m.group(4));
}
}
}