Wire up queries to regexes. Fix bug in limits on regex queries