Add code to allow maxlength to be set to a number. This enables a recursive regex with a max length