AlexKotov,
var wordsContains = function(str, sub) {
var separator = '[а-яёa-z]';
var pattern = separator + '*' + sub + separator + '*';
var reg = new RegExp(pattern, 'gi');
var arr = str.replace(reg, '')
reg = new RegExp(separator+ '+', 'gi');
arr = arr.match(reg)||[]
return arr
}
alert(wordsContains('Привет! Hello!hello!olo!world qwerty', 'o'));