(PDB-950) Added validation for regexps in queries