Slay Email Demons with Regex Beats 96.69%
IntuitionThis is a classic regex problem. Despite the arcane syntax, it is the most concise way to solve these types of problems.ApproachGiven constraints, we w
# Intuition
This is a classic regex problem. Despite the arcane syntax, it is the most concise way to solve these types of problems.

# Approach
Given constraints, we want to use Extended Regex (including the + which is equivalent to 1-or-more-occurences).

The username must contain alnum (lower/upper/numeral) at least one character (and excepting the '@' symbol).

The domain name must contain alpha at least one character (you are worth millions if you have one of those one character dotcom domains lol) (and excepting the '@' symbol).

Then ending in '.com' literally with end of string.


# Code
```mysql []
# Write your MySQL query statement below
SELECT *
FROM Users
WHERE REGEXP_LIKE(email, '[a-zA-Z0-9^@]+@[a-zA-Z^@]+\.com$')
ORDER BY user_id
```
['MySQL']