Skip to content

Instantly share code, notes, and snippets.

@eagleon
Created July 30, 2012 08:59
Show Gist options
  • Save eagleon/3205735 to your computer and use it in GitHub Desktop.
Save eagleon/3205735 to your computer and use it in GitHub Desktop.
正则表达式
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