lib/word/extract.rb
def extract_words(wildcard = Word::WILDCARD)
      word = /".*?"|'.*?'|#{wildcard}?\w+#{wildcard}?/ # "word1 word2" | 'word1 word2' | word
      scan(word).flatten.map{|x| x.gsub(/"|'/, '"')}.uniq
    end
def extract_words(wildcard = Word::WILDCARD)
      word = /".*?"|'.*?'|#{wildcard}?\w+#{wildcard}?/ # "word1 word2" | 'word1 word2' | word
      scan(word).flatten.map{|x| x.gsub(/"|'/, '"')}.uniq
    end
def extract_words ( wildcard = Word :: WILDCARD ) word = / #{ wildcard } \w #{ wildcard } / # "word1 word2" | 'word1 word2' | word scan ( word ) . flatten . map { | x | x . gsub ( / / , '"' ) } . uniq end
"a b 'c d'" => ["a", "b", "\"c d\""]
a b c d = > [ a b \ c d \ ]