programming-examples/js/Vre1/Check whether a given value is hexadecimal value or not.js
2019-11-15 12:59:38 +01:00

17 lines
403 B
JavaScript

function is_hexadecimal(str)
{
regexp = /^[0-9a-fA-F]+$/;
if (regexp.test(str))
{
return true;
}
else
{
return false;
}
}
console.log(is_hexadecimal("ffffff"));
console.log(is_hexadecimal("fz5500"));