First pass of regex constructor.