Write a validateEmail function to validate email addresses using regular expressions. The function must determine whether an email address is valid or not. For simplicity, an email address will be considered valid if it ends with the domain @company.com and if the domain is preceded by at least one character, which can be either a letter or a number.
Scala Regex
Valid email
Report a typo
Write a program in Scala 3
def validateEmail(email: String): Boolean =
??? // Write your code here
___
By continuing, you agree to the JetBrains Academy Terms of Service as well as Hyperskill Terms of Service and Privacy Policy.
Create a free account to access the full topic
By continuing, you agree to the JetBrains Academy Terms of Service as well as Hyperskill Terms of Service and Privacy Policy.