Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

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()
Comment

PREVIOUS NEXT
Code Example
Javascript :: angular decode url 
Javascript :: angular datatable reload with pagination 
Javascript :: vue watch props 
Javascript :: unique string id js 
Javascript :: javascript to string big number 
Javascript :: make contenteditable false javascript 
Javascript :: add image in react native 
Javascript :: FATAL ERROR: MarkCompactCollector: young object promotion failed Allocation failed - JavaScript heap out of memory 
Javascript :: js spread exclude property 
Javascript :: compose javascript 
Javascript :: uuid timestamp in javascript 
Javascript :: dynamic copyright year js 
Javascript :: write to console using jQuery 
Javascript :: javascript parse xml 
Javascript :: altv rpc 
Javascript :: insert image into datatable 
Javascript :: set url parameters javascript 
Javascript :: js clear dictionary 
Javascript :: kamus bahasa inggris 
Javascript :: How to swap two array elements in JavaScript 
Javascript :: javascript get first 3 characters of string 
Javascript :: remove underline from hyperlink react 
Javascript :: How to get all input fields inside div with JavaScript 
Javascript :: jQuery on right mouse click 
Javascript :: nextjs change port 
Javascript :: jquery sort listing alphabetically 
Javascript :: Unable to resolve module react-native-permissions 
Javascript :: mongoose get raw 
Javascript :: node get absolute path 
Javascript :: js check link if exists 
ADD CONTENT
Topic
Content
Source link
Name
2+1 =