MODE-1773 Made the projection expressions more general

Changed the regular expression inside the code and in the JSON Schema.

This should be merged into the '3.1.x' branch and cherry-picked into the 'master' branch.