67,513
社区成员
发帖
与我相关
我的任务
分享
String[] sources=new String[]{"sdfsdf.jpg"};
//String reg="(?i).+?\\.(jpg|gif|bmp)";
String reg = "\\w+\\.(jpg|gif|bmp|png)";
for(int i=0; i <sources.length;i++){
System.out.println(sources[i].matches(reg));
}
String str = rs.getString("question");
out.println(str+"&&&&&&&&&&&&&");
String[] sources=new String[]{str};
String regan="(?i).+?\\.(jpg|gif|bmp).*";//判断是否存在图片
for(int p=0;p<sources.length;p++){
if(sources[p].matches(regan)==true){
是
}else{
否
}
}