package regular;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
public class RegularExpress {
private static Pattern illegal_database_field =Pattern.compile("[(\\W+) && [^-+#]]");
public static boolean checkIllegalField(String fieldName) throws Exception{
Matcher matcher = illegal_database_field.matcher(fieldName);
while(matcher.find()){
System.out.println(matcher.group(0));
return true;
}
return false;
}
public static void main(String[] args) throws Exception{
String fieldName = "ö12345fsdfasfda";
RegularExpress regularExpress = new RegularExpress();
System.out.println(regularExpress.checkIllegalField(fieldName));
}
}
Regular Expression
原创
©著作权归作者所有:来自51CTO博客作者mb65017f8b83427的原创作品,请联系作者获取转载授权,否则将追究法律责任
上一篇:LDAP 部署
下一篇:VB knowledge
提问和评论都可以,用心的回复会被更多人看到
评论
发布评论
相关文章
-
Regular Expression Language Elements
VMware-Fusion-3.1.3-416484-light.dmg .NET Framework 4 Other Versions A regular expression is a pattern
职场 休闲 Regular Expression Language Elements -
Regular Expression(RegEx) 概述
正则表达式(英语:Regular Expression、regex或regexp,缩写为RE),也译为正规表示法、常规表示法,在计算机科学中,要有"T
regex 正则表达式 string 文本编辑 工具