Easy to understand
IntuitionThe goal is to filter valid email addresses ending in .com.
Regular expressions (~ operator) help match a structured pattern.
Sorting by user_id ensure
# Intuition
The goal is to filter valid email addresses ending in .com.
Regular expressions (~ operator) help match a structured pattern.
Sorting by user_id ensures a consistent order in results.

^ → Start of string.
[a-zA-Z0-9]+ → Username with letters and digits.
@ → Mandatory @ symbol.
[a-zA-Z]+ → Domain name with only letters.
\.com$ → Ends with .com.


# Code
```postgresql []
select *
from users
where email ~ '^[a-zA-Z0-9]+@[a-zA-Z]+\.com$'
order by user_id;
```
['PostgreSQL']