RegexValidator
Base for pattern validators: the value must match pattern entirely, otherwise reason is reported.
@Validate can only reference object validators, so subclass with concrete arguments:
object SkuValidator : RegexValidator(Regex("[A-Z]{3}-\\d{4}"), "must be a SKU like ABC-1234")Content copied to clipboard