Типо так?
function compare(one = '', second = '') {
let oneArray = one.match(/([a-zA-Z]+)|(\d+)/g);
let secondArray = second.match(/([a-zA-Z]+)|(\d+)/g);
if (oneArray && oneArray[0] > 10) return false;
if (!oneArray || !secondArray) return false;
if (oneArray[0] != secondArray[0]) return false;
if (parseInt(oneArray[1]) < parseInt(secondArray[1])) {
return true;
}
return false;
}
console.log(compare('ty12', 'ty33')); // true
console.log(compare('ty121', 'ty33')); // false
console.log(compare('ty121', 'tyt33')); // false