Home >Backend Development >PHP Tutorial >Mailbox regular expression implementation code (for php)_PHP tutorial

Mailbox regular expression implementation code (for php)_PHP tutorial

WBOY
WBOYOriginal
2016-07-21 15:04:25942browse

I have been copying phone numbers and email regular expressions written by others on the Internet. Today I have a little leisure and fulfilled my wish of writing such an expression myself:

Copy code The code is as follows:

/**
* Email address regular expression
*/
$preg = '/^(w{1,25})@(w{1,16 })(.(w{1,4})){1,3}$/';
$b = 'ffgddayasdadasdf@gmialsdfsdfasd3.com.cn.org';
if(preg_match($preg, $b)){
echo "Matched";
}else{
echo "No match";
}

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/327780.htmlTechArticleI have been copying phone numbers and email regular expressions written by others online. I have a little leisure today and I have been thinking about it. My wish to write such an expression is fulfilled: Copy the code as follows...
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn