RFC822: email address validation with regular expressions

后端 未结 5 429
醉酒成梦
醉酒成梦 2020-12-07 03:40

as you know, this is how we validate an email address:

(?:(?:\\r\\n)?[ \\t])*(?:(?:(?:[^()<>@,;:\\\\\".\\[\\] \\000-\\031]+(?:(?:(?:\\r\\n)?[ \\t]
)+|\         


        
5条回答
  •  太阳男子
    2020-12-07 04:47

    I saw this expression yesterday

    /^([\w\!\#$\%\&\'\*\+\-\/\=\?\^\`{\|\}\~]+\.)*[\w\!\#$\%\&\'\*\+\-\/\=\?\^\`{\|\}\~]+@((((([a-z0-9]{1}[a-z0-9\-]{0,62}[a-z0-9]{1})|[a-z])\.)+[a-z]{2,6})|(\d{1,3}\.){3}\d{1,3}(\:\d{1,5})?)$/i
    

    from http://fightingforalostcause.net/misc/2006/compare-email-regex.php

提交回复
热议问题