orThrow

@DeprecatedAsErrorSince(version = KotoolsTypesVersion.V5_1_0)
fun orThrow(pattern: String): EmailAddressRegex

Deprecated (with error)

Use the 'of(String)' function instead.

Replace with

import org.kotools.types.EmailAddressRegex
requireNotNull(EmailAddressRegex of pattern)

Returns a regular expression for validating email addresses from the specified pattern, or throws an IllegalArgumentException if the pattern doesn't match the default one.

See the orNull function for returning null in case of invalid pattern instead of throwing an exception.