const text = "Hola Crack de la Programación !"; const searchWord = "Crack"; function findWord(searchWord, text) { return RegExp('\\b'+ searchWord +'\\b').test(text) } console.log(findWord(searchWord, text)); // Output: true