1664. Find Users With Valid E-Mails
My accepted SQL solution to LeetCode problem 1664, Find Users With Valid E-Mails, running in 710ms.
- Difficulty: Easy
- SQL
- Runtime 710ms
- Memory 0.0B
- Updated
Read the problem on LeetCode View on GitHub
The problem statement is LeetCode’s and stays on their site. What follows is my accepted solution.
SQL
Accepted on LeetCode — runtime 710ms, memory 0.0B, accepted 2026-01-02.
# Write your MySQL query statement below
SELECT *
FROM Users
WHERE mail LIKE '%@leetcode.com' COLLATE utf8mb4_bin
AND mail REGEXP '^[a-zA-Z][a-zA-Z0-9_.-]*@leetcode\.com$'