用字符串判断性能比正则好,String imgExt = "jpg|jpeg|png|bmp|GIF|JPG|PNG|JPEG"; imgExt .indexOf("图片后缀") >= 0或者 imgExt .contains("图片后缀")这两种就可以