JSFiddle - React, Tailwind, and code Playground
JavaScript
var userId = "12345abcde";
//Get First and Second Five Characters
var firstFive = userId.substring(0, 5);
var secondFive = userId.substring(5, 10);
//get Global Letter and Nummers
var aStr = /[a-z, A-Z]/g;
var aNum = /[0-9]/g;
var c = userId.match(aNum);
alert(
'firstFive: ' + firstFive +
' and its type: ' + typeof(firstFive) +
' hasNumbers: ' + c +
' and its type: ' + typeof(c)
);
if(firstFive === c){
alert('yes');
}else{
alert('nop');
}