更新时间:2023-11-28 10:16:04
CREATE TABLE emails (
email varchar
CONSTRAINT proper_email CHECK (email ~* '^[A-Za-z0-9._%-]+@[A-Za-z0-9.-]+[.][A-Za-z]+$')
);
(正则表达式可能不完整,您可以在网络上搜索匹配电子邮件的正则表达式,然后选择您最喜欢的一个)。
(regex may be incomplete, you can search for regexp for email matching all over the web and pick the one you like best).