📜  java 验证字符串是否为十六进制 - Java 代码示例

📅  最后修改于: 2022-03-11 14:52:07.910000             🧑  作者: Mango

代码示例1
private static final Pattern HEXADECIMAL_PATTERN = Pattern.compile("\\p{XDigit}+");

private boolean isHexadecimal(String input) {
    final Matcher matcher = HEXADECIMAL_PATTERN.matcher(input);
    return matcher.matches();
}