algorithm to find regex suggestions; display is not done yet.