Java正则匹配
import java.util.regex.Matcher;
import java.util.regex.Pattern;
public class Test {
private static Pattern pattern = Pattern.compile("(.*?(?:\\.png|\\.jpg|\\.jpeg|\\.gif|\\.bmp))");
public static void main(String[] args) {
Matcher m = pattern.matcher(".png");
System.out.println(m.matches());
}
}