y
const text = 'text text text id12345 text text text';
if(text.match('id1\\d{4}')){
console.log('Perfect!', text);
}
if(text.match(/id1\d{4}/)){
console.log('very good', text);
}
const m = text.match(/\b(id\d+)\b/);
if(m){
console.log('Good', m[1]);
}