Could you get multiple levels of nesting? Will they be parsed?

I would also suggest extracting the logic of converting the query into options, into a separate private method, and possibly extracting the regexp into a constant.