Home >Backend Development >PHP Tutorial >An example of regular expression for php mailbox detection
This article introduces a piece of PHP code that uses regular expressions to match mailboxes. Friends in need can refer to it.
php email regular expression example: <?php /** * 邮箱地址正则表达式 * edit bbs.it-home.org */ $preg = '/^(\w{1,25})@(\w{1,16})(\.(\w{1,4})){1,3}$/'; $b = 'ffgddayasdadasdf@gmialsdfsdfasd3.com.cn.org'; if(preg_match($preg, $b)){ echo "匹配到了"; }else{ echo "未匹配"; } ?> |