orNull

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

Deprecated (with error)

Use the 'of(String)' function instead.

Replace with

import org.kotools.types.EmailAddressRegex
EmailAddressRegex of pattern

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

This function is not available from Java code due to its non-explicit support for nullable types.

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