Add code to allow maxlength to be set to a number.

This allows a recursive regex to have a max length.