Move $regex/$options to the new model

Better type-checking for $regex, and it's an error to provide $options
without $regex.