regexp query initial commit, with tests