of
@ExperimentalSince(version = KotoolsTypesVersion.V5_1_0)
Returns a regular expression for validating email addresses with the specified pattern, or returns null if the pattern doesn't match the default one.
Calling from Kotlin
Here's an example of calling this function from Kotlin code:
assertNotNull(EmailAddressRegex of """^[a-z]+@[a-z]+\.[a-z]+$""")Content copied to clipboard
Calling from Java
Here's an example of calling this function from Java code:
final String pattern = "^[a-z]+@[a-z]+\\.[a-z]+$";
final EmailAddressRegex result = EmailAddressRegex.of(pattern);
Assertions.assertNotNull(result);Content copied to clipboard