var str = 'word "big phrase" word "big phrase"', words = []; str.replace(/"([^"]*)"|[\S]+/g, function(word, phrase) { words.push(phrase || word); }); alert(words.join('\n'));