Fetching regular expressions from DB simplified by joining getting cursor and fetching data from cursor