1517. Find Users With Valid E-Mails
Pandas
import pandas as pd
def valid_emails(users: pd.DataFrame) -> pd.DataFrame:
return users[users['mail'].str.match(r'^[a-zA-Z][a-zA-Z0-9_.-]*@leetcode\.com$')]
SQL
SELECT
user_id,
name,
mail
FROM Users
WHERE mail REGEXP '^[a-zA-Z][a-zA-Z0-9_.-]*@leetcode\\.com$'