Added MustMatchRegex to the DataRules.

This commit is contained in:
ruri
2019-05-28 18:08:39 +02:00
parent 68102eb6d4
commit 6f0f94a354
2 changed files with 8 additions and 1 deletions
+4
View File
@@ -83,6 +83,10 @@ namespace RuriLib.Models
case RuleType.MustNotContain:
valid = !CheckContains(slice, rule.RuleString);
break;
case RuleType.MustMatchRegex:
valid = Regex.Match(slice, rule.RuleString).Success;
break;
}
if (!valid) return false;
+4 -1
View File
@@ -23,7 +23,10 @@ namespace RuriLib.Models
MinLength,
/// <summary>The slice's length must be smaller or equal to a given number.</summary>
MaxLength
MaxLength,
/// <summary>The slice must match a given regex pattern.</summary>
MustMatchRegex
}
/// <summary>