You can try this:
var str="RANDOM1";
if(/^RANDOM\d+$/gi.test(str))
console.log('true');
else
console.log('false');
solved What will be the Regular expression for matching a constant word ending with number
You can try this:
var str="RANDOM1";
if(/^RANDOM\d+$/gi.test(str))
console.log('true');
else
console.log('false');
solved What will be the Regular expression for matching a constant word ending with number