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
This might be a very late answer, but I am interested in answering
([\w]+|\"[\w\s]+\")
http://regex101.com/r/dZ1vT6/72
Pure javascript example
'The rain in "SPAIN stays" mainly in the plain'.match(/[\w]+|\"[\w\s]+\"/g)
Outputs:
["The", "rain", "in", ""SPAIN stays"", "mainly", "in", "the", "plain"]