Created
July 30, 2012 08:59
-
-
Save eagleon/3205735 to your computer and use it in GitHub Desktop.
正则表达式
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1. 文件类型匹配: | |
Pattern reg=Pattern.compile("[.]jpg|png|jpeg|gif$"); | |
Matcher matcher=reg.matcher(fileName); | |
if(!matcher.find()) { | |
state = "文件类型不允许!"; | |
break; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment