java正则匹配count字符串

public static boolean getCountSql(String sql) {
String regex = "(^select)(\\s?count.*?)(from .*)";
Pattern p = Pattern.compile(regex, Pattern.CASE_INSENSITIVE);
Matcher m = p.matcher(sql);
return m.find();
}

你可能感兴趣的:(java,字符串,count)