Valid email

Report a typo

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.

Sample Input 1:

Sample Output 1:

true
Write a program in Scala 3
def validateEmail(email: String): Boolean =
??? // Write your code here
___

Create a free account to access the full topic