(PDB-950) Added validation for regexps in queries

This commit adds a validation for regexps in queries as was proposed in PDB-950
validate-binary-operators does this tree traversal for you, if we move the validation there its simpler.