private void ValidateStringProperty(string target, ConfigurationPrimitivePropertyModel propertyModel, List <string> errors)
 {
     if (propertyModel.ValidationRules.MaxLength.HasValue && target.Length > propertyModel.ValidationRules.MaxLength)
     {
         errors.Add(ValidationStrings.GreaterThanMaxLength(propertyModel.ConfigurationPropertyName, propertyModel.ValidationRules.MaxLength));
     }
     if (!string.IsNullOrWhiteSpace(propertyModel.ValidationRules.Pattern) && !Regex.IsMatch(target, propertyModel.ValidationRules.Pattern))
     {
         errors.Add(ValidationStrings.MatchesPattern(propertyModel.ConfigurationPropertyName, propertyModel.ValidationRules.Pattern));
     }
 }