than_
02/01/2022, 11:05 AM@JvmInline
@Serializable
value class Email(val value: String) {
init {
pre(value.matches(emailRegex)){ "Must be a valid email" }
}
override fun toString(): String = value
}
which of course won't work since
You can only create Boolean expressions using basic arithmetic operations (addition, subtraction, …), comparisons, and simple Boolean operations (and, or, not). In particular, you cannot define a Boolean function and use it in a condition;
Will there be possibility of regex matching in the future or should we use a runtime solution?raulraja
02/03/2022, 10:45 AMthan_
02/03/2022, 2:59 PM