Change the way regular expressions are validate

Before if a parameter has a regular expression to validate, always was validate against this regular expresion instead the parameter wasn't required. Now if the parameter isn't required and the parameter values is null or '' the regular expression isn't validate.