less than 1 minute read

Problem

problem-1517

Query

SELECT
    *
FROM
    Users
WHERE
    mail REGEXP '^[a-zA-Z]+[._-a-zA-Z0-9]*@leetcode\\.com$'

Editorial Solution

SELECT user_id, name, mail
FROM Users
-- Note that we also escaped the `@` character, as it has a special meaning in some regex flavors
WHERE mail REGEXP '^[a-zA-Z][a-zA-Z0-9_.-]*\\@leetcode\\.com$';

Tags:

Updated: