$regex = '[\u4e00-\u9fa5]'; //匹配中文字符的正則表達式
$regex = '^[\u4E00-\u9FA5A-Za-z0-9]+$'; or $regex = '^[\u4E00-\u9FA5A-Za-z0-9]{2,20}$'; //中文、英文、數字但不包括下劃線等符號
$regex = '^[a-zA-Z][a-zA-Z0-9_]{4,15}$'; //賬號是否合法(字母開頭,容許5-16字節,容許字母數字下劃線)
$regex = '[^\x00-\xff]'; //匹配雙字節字符(包括漢字在內)
$regex = '\n[\s| ]*\r'; //匹配空行的正則表達式
$regex = '/<(.*)>.*<\/\1>|<(.*) \/>/'; //匹配HTML標記的正則表達式
$regex = '(^\s*)|(\s*$)'; //匹配首尾空格的正則表達式
$regex = '/(\d+)\.(\d+)\.(\d+)\.(\d+)/g'; //匹配IP地址的正則表達式
$regex = '\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*'; //匹配Email地址的正則表達式
$regex = '^(13[0-9]|14[5|7]|15[0|1|2|3|5|6|7|8|9]|18[0|1|2|3|5|6|7|8|9])\d{8}$'; //手機號
$regex = '^[1-9]\d{5}(18|19|([23]\d))\d{2}((0[1-9])|(10|11|12))(([0-2][1-9])|10|20|30|31)\d{3}[0-9Xx]$'; //18位身份證號
$regex = '[a-zA-z]+://[^\s]* 或 ^http://([\w-]+\.)+[\w-]+(/[\w-./?%&=]*)?$'
$data = "***********";
if (preg_match($regex,$data)) { echo "驗證成功"; } else { echo "你輸入的是啥玩意?"; }