var bulk_string=$('.content_class_name').val(); var given_word = 'myfavourate'; var regex = new RegExp( '\b' + given_word + '\b' ); var result = regex.test(bulk_string); if(result==true) { alert("Word exists in given string"); return false; }