added the regex case for query