protected static boolean isFullString(String s) {
Pattern pattern = Pattern.compile("^[^ -~。-゚]+$");
Matcher matcher = pattern.matcher(s);
return matcher.matches();
}
protected static boolean isHalfAl(String s) {
Pattern pattern = Pattern.compile("^[a-zA-Z]+$");
Matcher matcher = pattern.matcher(s);
return matcher.matches();
}
protected static boolean isHalNum(String s) {
Pattern pattern = Pattern.compile("^[0-9]+$");
Matcher matcher = pattern.matcher(s);
return matcher.matches();
}
protected static boolean isHalfAlNum(String s) {
Pattern pattern = Pattern.compile("^[a-zA-Z0-9]+$");
Matcher matcher = pattern.matcher(s);
return matcher.matches();
}
protected static boolean isAlNumSign(String s) {
Pattern pattern = Pattern.compile("^[a-zA-Z0-9 -/:-@\[-\`\{-\~]+$");
Matcher matcher = pattern.matcher(s);
return matcher.matches();
}
protected static boolean isHalfKana(String s) {
Pattern pattern = Pattern.compile("^[。-゚+]+$");
Matcher matcher = pattern.matcher(s);
return matcher.matches();
}
protected static boolean isHiragana(String s) {
Pattern pattern = Pattern.compile("^[ぁ-ゞ]+$");
Matcher matcher = pattern.matcher(s);
return matcher.matches();
}
protected static boolean isFullKana(String s) {
Pattern pattern = Pattern.compile("^[ァ-ヶ]+$");
Matcher matcher = pattern.matcher(s);
return matcher.matches();
}
0 コメント:
コメントを投稿