I know this is a late addition, but would using derived types like token or normalizedString provide you this solution, or do you need to allow for interior line breaks and repetitious whitespace?
token
normalizedString