Answers for "javascript check if number is hexadecimal"

0

javascript check if number is hexadecimal

var re = /[0-9A-Fa-f]{6}/g;
var inputString = 'AABBCC';

if(re.test(inputString)) {
    alert('valid hex');
} else {
    alert('invalid');
}

re.lastIndex = 0; // be sure to reset the index after using .text()
Posted by: Guest on June-14-2020

Code answers related to "javascript check if number is hexadecimal"

Code answers related to "Javascript"

Browse Popular Code Answers by Language