public Tag Parse(string tag, string value) { Version version = new Version(tag); if (!_regex.IsMatch(value ?? string.Empty)) { string errorMessage = string.Format(DmarcParserResource.InvalidValueErrorMessage, Tag, value); version.AddError(new Error(ErrorType.Error, errorMessage)); } return(version); }
public Version Parse(string versionString) { Version version = new Version(versionString); if (versionString == null || !_regex.IsMatch(versionString)) { string errorMessage = string.Format(SpfParserResource.InvalidValueErrorMessage, "SPF version", version); version.AddError(new Error(ErrorType.Error, errorMessage)); } return(version); }