//用户名必须为字母、数字与下划线if (!preg_match(‘/^\w+$/i‘, $username))
//验证邮箱格式是否正确if (!preg_match(‘/^[\w\.]+@\w+\.\w+$/i‘, $useremail))
//手机号必须为11位数字,且为1开头if (!preg_match(‘/^1\d{10}$/i‘, $usermobile))
PHP常用正则表达式
原文:http://www.cnblogs.com/besti/p/4330999.html