I need to support exact phrases (enclosed in quotes) in an otherwise space-separated list of terms. Thus splitting the respective string by the space-character is not suffic
how about,
output = /(".+?"|\w+)/g.exec(input)
then do a pass on output to lose the quotes.
alternately,
output = /"(.+?)"|(\w+)/g.exec(input)
then do a pass n output to lose the empty captures.