Simple and easy !
IntuitionUsing Regular expressionsApproachSimple regex solution , using regex for pattern matchingComplexity
Time complexity:
Worst-case O(N × M) for filtering,
# Intuition
<!-- Describe your first thoughts on how to solve this problem. -->
Using Regular expressions
# Approach
<!-- Describe your approach to solving the problem. -->
Simple regex solution , using regex for pattern matching
# Complexity
- Time complexity:
<!-- Add your time complexity here, e.g. $$O(n)$$ -->
Worst-case O(N × M) for filtering, O(N log N) for sorting.
If user_id is indexed, sorting is O(N).

- Space complexity:
<!-- Add your space complexity here, e.g. $$O(n)$$ -->
Space complexity is O(N) in case sorting requires memory.
# Code
```mysql []
# Write your MySQL query statement below
SELECT * FROM Users
WHERE email REGEXP '^[a-zA-Z0-9_]+@[a-zA-Z]+\.com'
ORDER BY user_id

```
['MySQL']