added handling of edge cases where regexes or strings can contain the "query:" token which should be be parsed