{ "data": { "question": { "questionId": "3782", "questionFrontendId": "3436", "categoryTitle": "Database", "boundTopicId": 3059804, "title": "Find Valid Emails", "titleSlug": "find-valid-emails", "content": "
Table: Users
\n+-----------------+---------+\n| Column Name | Type |\n+-----------------+---------+\n| user_id | int |\n| email | varchar |\n+-----------------+---------+\n(user_id) is the unique key for this table.\nEach row contains a user's unique ID and email address.\n\n\n
Write a solution to find all the valid email addresses. A valid email address meets the following criteria:
\n\n@
symbol..com
.@
symbol contains only alphanumeric characters and underscores.@
symbol and before .com
contains a domain name that contains only letters.Return the result table ordered by user_id
in ascending order.
\n
Example:
\n\nInput:
\n\nUsers table:
\n\n\n+---------+---------------------+\n| user_id | email |\n+---------+---------------------+\n| 1 | alice@example.com |\n| 2 | bob_at_example.com |\n| 3 | charlie@example.net |\n| 4 | david@domain.com |\n| 5 | eve@invalid |\n+---------+---------------------+\n\n\n
Output:
\n\n\n+---------+-------------------+\n| user_id | email |\n+---------+-------------------+\n| 1 | alice@example.com |\n| 4 | david@domain.com |\n+---------+-------------------+\n\n\n
Explanation:
\n\n@
, alice is alphanumeric, and example.com starts with a letter and ends with .com.@
..com
..com
.Result table is ordered by user_id in ascending order.
\n表:Users
\n+-----------------+---------+\n| Column Name | Type |\n+-----------------+---------+\n| user_id | int |\n| email | varchar |\n+-----------------+---------+\n(user_id) 是这张表的唯一主键。\n每一行包含用户的唯一 ID 和邮箱地址。\n\n\n
编写一个解决方案来查找所有 合法邮箱地址。一个合法的邮箱地址符合下述条件:
\n\n@
符号。.com
结尾。@
符号前面的部分只包含 字母数字 字符和 下划线。@
符号后面与 .com
前面的部分 包含 只有字母 的域名。返回结果表以 user_id
升序 排序。
\n\n
示例:
\n\n输入:
\n\nUsers 表:
\n\n\n+---------+---------------------+\n| user_id | email |\n+---------+---------------------+\n| 1 | alice@example.com |\n| 2 | bob_at_example.com |\n| 3 | charlie@example.net |\n| 4 | david@domain.com |\n| 5 | eve@invalid |\n+---------+---------------------+\n\n\n
输出:
\n\n\n+---------+-------------------+\n| user_id | email |\n+---------+-------------------+\n| 1 | alice@example.com |\n| 4 | david@domain.com |\n+---------+-------------------+\n\n\n
解释:
\n\n@
,alice 是只有字母数字的,并且 example.com 以字母开始并以 .com 结束。@
。.com
结尾。.com
结尾。结果表以 user_id 升序排序。
\n\\u7248\\u672c\\uff1a mssql server 2019.<\\/p>\"],\"oraclesql\":[\"Oracle\",\" Oracle Sql 11.2.<\\/p>\"],\"pythondata\":[\"Pandas\",\" Python 3.10 with Pandas 2.2.2 and NumPy 1.26.4<\\/p>\"],\"postgresql\":[\"PostgreSQL\",\" PostgreSQL 16<\\/p>\"]}",
"book": null,
"isSubscribed": false,
"isDailyQuestion": false,
"dailyRecordStatus": null,
"editorType": "CKEDITOR",
"ugcQuestionId": null,
"style": "LEETCODE",
"exampleTestcases": "{\"headers\":{\"Users\":[\"user_id\",\"email\"]},\"rows\":{\"Users\":[[1,\"alice@example.com\"],[2,\"bob_at_example.com\"],[3,\"charlie@example.net\"],[4,\"david@domain.com\"],[5,\"eve@invalid\"]]}}",
"__typename": "QuestionNode"
}
}
}MySQL 8.0<\\/code><\\/p>\"],\"mssql\":[\"MS SQL Server\",\"