public
class
AA {
public
static
void
main(String[] args) {
String s=
"123bf"
;
String regex=
"^[A-Fa-f0-9]+$"
;
if
(s.matches(regex)){
System.out.println(s.toUpperCase()+
"是16进制数"
);
}
else
{
System.out.println(s.toUpperCase()+
"不是16进制数"
);
}
}
}