Fixed regex validation.
Added the ability to set a default value for optional parameters.