pattern

fun pattern(value: String, regex: String): String?(source)

Checks @Pattern: the whole value must match regex.